db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahler Thomas <thomas.mah...@itellium.com>
Subject AW: Oracle default JDBC datatype for DATE
Date Tue, 28 Jan 2003 14:13:12 GMT
Hi Manfred,

The official JDBC typemapping is described here:

This page also shows how to use FieldConversions to tell OJB to perform the
correct type conversions for you.


> -----Urspr√ľngliche Nachricht-----
> Von: Geiler Manfred [mailto:Manfred.Geiler@oekb.at]
> Gesendet: Dienstag, 28. Januar 2003 11:01
> An: ojb-dev@jakarta.apache.org
> Betreff: 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
> --
> To unsubscribe, e-mail:   
> <mailto:ojb-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ojb-dev-help@jakarta.apache.org>

View raw message