Re: Storing time values via jdbc thin driver

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: Fri, 28 Nov 2008 09:38:41 -0800 (PST)
Message-ID: <32e463de-a6d4-4267-b7b4-0b6a0cfa4449@z1g2000yqn.googlegroups.com>


On Nov 28, 7:02 pm, "Chris Seidel" <csei..._at_arcor.de> 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.

Regards,

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

Original text of this message