I used Informix to do some test and I noticed that if I had a attribute in java.util.Date, it is automatically converted in DATETIME HOUR TO SECOND in Informix. By that way, the data base doesn't persist the day but only the hour (ex : 18:08:34). When I ask load the data from Informix, Java tolds me that the date is "1 May 1970 16:08:34 GMT", it's the right hour. (I live in French and we had 2 hours more that GMT)
With Informix, in order to obtain a right result I told in the mapping file that the field in Hibernate's type is "Time". The attribute is thus converted into DATETIME YEAR TO FRACTION(5). I have the good informations in Database (ex:2004-05-04 18:08:34.00000) but when I load the data from Informix, Java tolds me that the day is still "1 May 1970 17:08:34 GMT", it a wrong date and a wrong hour.
I found it strange and I wonder if it's a bug.
I did the same on MaxDB and I got a Timestamp. That was normal and I had the right date on loading : "4 May 2004 16:08:34 GMT".
_________________ Xavier MOGHRABI
http://www.enstimac.fr/~moghrabi
|