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: strange problem using DATE fields from coldfusion/MX (jdbc)

Re: strange problem using DATE fields from coldfusion/MX (jdbc)

From: <joeNOSPAM_at_BEA.com>
Date: 18 Jul 2006 19:30:02 -0700
Message-ID: <1153276202.341606.34360@s13g2000cwa.googlegroups.com>

Yoram Ayalon wrote:
> existing coldfusion 5 code, using ODBC connections, can SELECT and
> UPDATE oracle (9.2) DATE fields, without any problems.
>
> when checking same functionality with the coldFusion MX, which uses
> jdbc, we are using the 10g thin client (ojdbc14.jar), you cannot
> SELECT or UPDATE the time component of the field. everything's is read
> as on midnight.
>
> any clue ?

Yes. Oracle made a mistake in their current JDBC drivers, mapping a DATE column to a java.sql.Date. A java.sql.Date is just that, having no time component, so the driver merrily discards the time portion of your data (if you call getObject()). If you call getTimestamp() you get all the data. Their weak excuse is that they map their new TIMESTAMP column type to a java.sql.Timestamp. That is of course irrelevant. If Oracle had 10 column types, all of which stored some time+date value, they should all map to a java.sql.Timestamp.

   That being said, there is a driver property you should add to your connection parameters, which will revert this behavior:

oracle.jdbc.V8Compatible=true

Add that and let me know...
Joe Weinstein at BEA Systems Received on Tue Jul 18 2006 - 21:30:02 CDT

Original text of this message

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