db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geiler Manfred" <Manfred.Gei...@oekb.at>
Subject RE: Oracle default JDBC datatype for DATE
Date Tue, 28 Jan 2003 14:27:16 GMT
Hi Thomas!

This is not my problem.
I understand the JDBC Typemapping in OJB and of course I know of the FieldConversion feature
- I'm no OJB newbie  ;-)

My real problem is the Oracle drivers typemapping: Oracle database (!) type "DATE" to JDBC
Type "DATE" instead of JDBC Type "TIMESTAMP".
(Sorry if I did not state this clear enough)

My arising OJB problem is, that OJB determines the datatype of a column in a report (!) query
from the ResultSetMetaData (this is where this Oracle issue plays a role) and not from the
type definition in the XML repository file as it is done during a "normal" object query.

Thanks,
Manfred

-----Original Message-----
From: Mahler Thomas [mailto:thomas.mahler@itellium.com] 
Sent: Tuesday, January 28, 2003 3:13 PM
To: 'OJB Developers List'
Subject: AW: Oracle default JDBC datatype for DATE


Hi Manfred,

The official JDBC typemapping is described here:
http://jakarta.apache.org/ojb/jdbc-types.html

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

cheers,
Thomas

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


--
To unsubscribe, e-mail:   <mailto:ojb-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-dev-help@jakarta.apache.org>


Mime
View raw message