Re: Storing time values via jdbc thin driver

From: Vladimir M. Zakharychev <>
Date: Fri, 28 Nov 2008 09:38:41 -0800 (PST)
Message-ID: <>

On Nov 28, 7:02 pm, "Chris Seidel" <> wrote:
> Hi,
> I have an Oracle 9.2 database.
> If I use the 9.2 driver java.sql.Time is stored with 1900-01-01 HH:MM.
> If I use the 10.2 driver java.sql.Time is stored with 1970-01-01 HH:MM.
> Is this a know bug/feature?
> Do I have to update all my records to 1970 when using oracle 10 driver?
> Thank you

If you check the java.sql.Time class specification, it says: "The date components should be set to the "zero epoch" value of January 1, 1970 and should not be accessed." So it seems that 10.2 behavior is consistent with the J2EE specification while 9.2 is not, which might be a bug in 9.2 driver or, more probably, a bug-like feature. However, since the date component is meaningless for java.sql.Time, I think it's not really important what its value is in the database as it probably will be properly reset in Java when retrieved and you don't need it anyway.


   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm) Received on Fri Nov 28 2008 - 11:38:41 CST

Original text of this message