Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 71174 invoked from network); 15 Jun 2004 15:24:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Jun 2004 15:24:33 -0000 Received: (qmail 55822 invoked by uid 500); 15 Jun 2004 15:24:40 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 55792 invoked by uid 500); 15 Jun 2004 15:24:40 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 55761 invoked by uid 99); 15 Jun 2004 15:24:39 -0000 Received: from [128.163.144.21] (HELO spitfire.ecc.engr.uky.edu) (128.163.144.21) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 15 Jun 2004 08:24:39 -0700 Received: from www by spitfire.ecc.engr.uky.edu with local (Exim 4.34) id 1BaFnO-0008fx-5y for torque-user@db.apache.org; Tue, 15 Jun 2004 11:24:18 -0400 Received: from 128.163.239.155 ([128.163.239.155]) by mail.engr.uky.edu (IMP) with HTTP for ; Tue, 15 Jun 2004 11:24:18 -0400 Message-ID: <1087313058.40cf14a21dacd@mail.engr.uky.edu> Date: Tue, 15 Jun 2004 11:24:18 -0400 From: Saravana Kannan To: Apache Torque Users List Subject: RE: DATE and TIMESTAMP in Oracle with Torque 3.1 References: <2F97C0E4A5A6BC4A825C9FE8C9B33BC401E53C05@iblonce107.gb.ad.drkw.net> In-Reply-To: <2F97C0E4A5A6BC4A825C9FE8C9B33BC401E53C05@iblonce107.gb.ad.drkw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 128.163.239.155 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Tony, Have you already done the fix? Is it simply a matter of creating a new java.sql. Timestamp (with the correct values stored in it) and returning it instead of the java.sql.Date? I have a patch for village to take care of the Oracle-BLOB problem and you have one for Oracle-Timestamp. I would like to combine both and have one single patch. Do you mind sending me the source or diff? -Sarav Quoting "Foster, Tony" : > This is a problem with the Oracle JDBC driver. In their wisdom, Oracle > decided that the 9i driver would interpret their database DATE type as > java.sql.Date, and thus truncate the time-to-the-second portion that it > stores. This, despite the 8i driver treating it as java.sql.Timestamp. > > What you need to do is patch the Village software to override this bizarre > not-a-bug-according-to-Oracle behaviour. I will send the jar to you > directly. > > Regards > > TT. > > -----Original Message----- > From: raphael.x.mankin@gsk.com [mailto:raphael.x.mankin@gsk.com] On Behalf > Of Raphael.X.Mankin%GSK%SB@gsk.com > Sent: 15 June 2004 2:46 pm > To: torque-user@db.apache.org > Subject: DATE and TIMESTAMP in Oracle with Torque 3.1 > > > > > I am using Torque 3.1 with an Oracle DB. I am trying to create tables that > have date/time fields. I find that it makes absolutely no difference whether > in the xml I declare the columns as DATE or TIMESTAMP; the DDL and code > generated are exactly the same. The effect of this is that the time > component of the timesamp is removed before the data is written to the DB. > For both DATE and TIMESTAMP fields the generated columns have SQL type DATE > and java type java.util.Date. > > There is a secondary problem. When I retrieve a row from the DB the > constructed date object is of type java.sql.Date instead of java.util.Date. > The causes an InstantiationException when the returned object is > subsequently passed to java.beans.XMLEncoder because the actual value does > not match the declared type. The documentation for java.sql.Date in fact > warns you that it should NOT be taken as a sub-type of java.util.Date. > > > So, it looks as if we need two fixes: > 1. To get full timestamps stored in the DB for Oracle (AFAIK the > implementation is correct for mySQL) 2. To ensure that the actual value of a > retrieved date or date/time matches its declared type. > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > > > -------------------------------------------------------------------------------- > The information contained herein is confidential and is intended solely for > the > addressee. Access by any other party is unauthorised without the express > written permission of the sender. If you are not the intended recipient, > please > contact the sender either via the company switchboard on +44 (0)20 7623 8000, > or > via e-mail return. If you have received this e-mail in error or wish to read > our > e-mail disclaimer statement and monitoring policy, please refer to > http://www.drkw.com/disc/email/ or contact the sender. 3166 > -------------------------------------------------------------------------------- > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > > -- There are 10 kinds of people in the world, those who know binary and those who don't. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org