You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Geiler Manfred <Ma...@oekb.at> on 2003/01/28 11:00:45 UTC

Oracle default JDBC datatype for DATE

Hello!
My problem is as follows:
When I do a report query with the (thin) Oracle JDBC driver, all columns of database type "DATE" have the default JDBC datatype java.sql.Date. Since the Oracle datatype "DATE" is actually a Timestamp (has both Date and Time) this default mapping of the JDBC driver is not correct, IMHO.
This is a real problem for me (and also for others I think), for this java.sql.Date objects always have a time "00:00:00" although they have a time value in the database.

Because I only see a slim chance that Oracle will fix this behaviour I have some hope, that there is a possibility in OJB to avoid this.

The ReportQueryRsIterator catches the datatype from the ResultSetMetaData:
	int jdbcType = rsMetaData.getColumnType(i + 1)
Wouldn't it be better to get the datatype from the object property, as it is done by "normal" queries. I understand that this cannot be done when a report column is an aggregate function, but what about normal columns?

Are there any plans to implement something like a setColumnType(int index, int jdbcType) method in the ReportQuery classes?

Thanks,
Manfred