Hi,

I have a database column TIMESTAMP of type DATE.
In the Java class the type for attribute timeStamp is java.util.Calendar.

repository.xml looks like this:

      <field-descriptor
         name="timeStamp"
         column="TIMESTAMP"
         jdbc-type="TIMESTAMP"
         primarykey="false"
         autoincrement="false"
         
conversion="org.apache.ojb.broker.accesslayer.conversions.Calendar2TimestampFieldConversion"
      />

Don't know if this gives you an idea. I guess you don't want to change the data 
type from java.sql.Timestamp to java.util.Date or java.util.Calendar.

Cheers,
Frank
 

-----Ursprüngliche Nachricht-----
Von: JML (Brujula) [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 29. Juni 2005 10:20
An: OJB Users List
Betreff: Problem with Oracle10g

Hi!

I have encountered with a problem when I have changed from Oracle9i to 
Oracle10g.

This code work correctly with 9i:

Timestamp tmp = (Timestamp)row[7];

row[7] is a field of a ReportQueryByCriteria from a table with DATE database 
type. In repository.xml, I have mapped this field as TIMESTAMP

<field-descriptor id="7" name="dateCreated" column="DATE_CREATED"
                    jdbc-type="TIMESTAMP"/>


But with Oracle10g, I have obtain a ClassCastException, because row[7] is a 
java.sql.Date.

When I execute:
System.out.println("CLASS: " +row[7].getClass());

I obtain,

CLASS: java.sql.Date

Thanks for any ideas


---------------------------------------------------------------------
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