we've had the same problem.
The cause seems to be the 9i JDBC-dirver that has a problem with the time-component of DATE-values. (Oracle 8i JDBC driver does fine.)
The problem is, that oracle returns DataType 91 (DATE) instead of 93 (Timestamp). Therfore in the workindogs-classes the time of the day is ignored afterwards.
We have put a work-around in the com.workingdogs classes in torque-utils.jar
I will mail a library workingdogs.jar to your mail-adress. Try that (and remove the corresponding classes from torque-utils.jar!).
Merry XMas to all!
Jan-Martin Roth
Dipl.Math. Jan-Martin Roth [EMAIL PROTECTED]
media transfer AG Dolivostr. 11 D-64293 Darmstadt Tel. +49 6151 8193 20 Fax +49 6151 8193 41 Web: http://www.mtg.de
Pierre Henry schrieb:
Hi all ,
There seems to be a problem when inserting into columns of type date into Oracle (9i).
I have an entity Projection with a field of type "date" in schema.xml.
Here is what I do : Date nowDate = new Date(); nowDate.setTime(System.currentTimeMillis()); Calendar now = new GregorianCalendar(); now.setTime(nowDate); now.set(Calendar.HOUR_OF_DAY, hourOfDay); now.set(Calendar.MINUTE, minutes); now.set(Calendar.SECOND, 0); now.set(Calendar.MILLISECOND, 0);
Projection proj = new Projection(); ... proj.setPDate(now.getTime()); proj.save();
But the sql query
select to_char(p_date,'DD-MM-YYYY HH24:MI:SS') from projection
shows that only the year-month-day values are stored. The hour-minutes are set to zeros.
I found an issue on this in the list archive dating back to 2002 (here is the url of the thread :
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&by=thread&from=194695 )
but there is no answer solving the problem, and it seems that it hasn't been fixed since then.
The change from date to timestamp in schema.xml does not affect the actual oracle type which is generated (which remains date).
Does anybody have a fix or workaround to this problem ? I would be very gratefull !!
Pierre Henry
--------------------------------------------------------------------- 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]
