Hi,

After struggling and searching for a solution to Oracle date comparisons,
I'ld like to share what I came up with.

Using the standard TIMESTAMP descriptor where "date" is a java.util.Date:
<field-descriptor
name="date"
column="audit_date"
jdbc-type="TIMESTAMP"
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion"
/>

and the criteria:
criteria.addGreaterThan("date", fromJavaUtilDate);
or:
criteria.addGreaterThan("date", fromJavaSqlDate);

p6spy always built this where clause which failed:

A0.audit_date >  '2003-01-01 00:00:00.0'

By setting the NSL_DATE_FORMAT in the init.ora to this:

nls_date_format="YYYY-MM-DD HH24:MI:SS"

we have success!

Hope that helps future Oracle developers.
Cheers,
Brad





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to