I actually use the following for dates against oracle:

<field-descriptor id="5"
    name="lastUpdateScan"
    column="LASTUPDATEDATE"
    jdbc-type="TIMESTAMP"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion"
  />

Where the field is defined as an Oracle Date
LASTUPDATEDATE            DATE

This works against 8.1.7 and I've never had issues.

The code snippet would work just fine if the conversion is from
java.util.Date to java.sql.Date, but I've found I prefer to set the
java.util.Date using the JavaDate2SqlTimestampFieldConversion function.

JR

-----Original Message-----
From: Durham David Contr 805 CSS/SCBE [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 31, 2003 12:51 PM
To: OJB Users List
Subject: RE: Oracle and Date field


> This looks like an insert to a varchar field not a Date
> field.  So I changed the column to a varchar and it worked.  
> So ....  I think this is not what I want.  Also, this doesn't 
> seem like the correct *default* behavior for jdbc-type of Date.


Ok, so apparently not everyone is as interested in this as I am.  Anywho
-- I tracked this little bugger down:

org.apache.ojb.broker.platforms.PlatformOracleImpl.java

    public void setObjectForStatement(PreparedStatement ps, int index,
Object value, int sqlType) throws SQLException
    {

        [snip]

        else if (sqlType == Types.DATE) {
            ps.setDate(index, (Date)value);
        }

        [snip]

    }

Any reason why people wouldn't want to use a Date field in this
scenario?

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


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

Reply via email to