Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 10g returns DATE as java.sql.Date?

Re: Oracle 10g returns DATE as java.sql.Date?

From: Bjorn Abelli <bjorn_abelli_at_DoNotSpam.hotmail.com>
Date: Wed, 9 Nov 2005 21:36:49 +0100
Message-ID: <43725db6$1_2@x-privat.org>

<thomas_okken_at_hotmail.com> wrote...

>I noticed that Oracle 10g XE, with the ojdbc14.jar JDBC driver,

> returns DATE columns as java.sql.Date valuess. That surprised
> me, because the ResultSetMetaData claims the column's Java type
> is java.sql.Timestamp -- which would make more sense since DATE
> columns contain date *and* time information, just just date.
> I seem to remember that Oracle 8i did return java.sql.Timestamp for
> DATE columns.
> Did they change this, or am I just misremembering? Is there a way to
> get the driver to return java.sql.Timestamp?

It seems like Oracle in an attempt to make their database more conforming to the SQL standards (where DATE actually doesn't contain time info, just the date, but instead has the TIMESTAMP datatype), have broken some backward compatibilities...

http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#08_01

// Bjorn A Received on Wed Nov 09 2005 - 14:36:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US