have you tried just passing the Date object to the setter? > -----Original Message----- > From: Pierre Henry [mailto:[EMAIL PROTECTED] > Sent: Friday, December 19, 2003 8:08 AM > To: [EMAIL PROTECTED] > Cc: Jean-Marc Jung > Subject: Oracle and Dates... > > > 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/BrowseList?listName=torque- > [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]
