Dear Sir or Madam,
we are using the JDBC 4.0 Driver for MS Access in an hibernate environment.
We downloaded the current version having the release date 2010-01-20 06:30.
Everything works great, but recently we spotted a problem regarding time zones.
Every update is 2 hours behind the current date.
Our location is Germnay, so there time zone should something like "Berlin" with daylight saving time. If I set the time zone manually to compensate the offet...
java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("GMT+2"));...
...it works.
Other JDBC drivers do not have this problem.
So please tell me, what is wrong ?
Thank you for your help.
Robert Nimax
|
What's your update sql? If you are using PreparedStatement, you should use PreparedStatement.setTimestamp(int parameterIndex, Timestamp x, Calendar cal).
|
We are not using PreparedStatement directly. We are using the Grails framework which uses hibernate for OR-Mapping.
May it is a workaround to use JDBC instaed of GORM respectively hibernate at these code areas, but isn´t any other possibility ?
|
OK, I checked it. If we convert the calculated date (java.util.Date)to a java.sql.Timestamp, the prepared statement will work correcty and do a good job. But the problem is, that we actually do not use the JDBC-API directly because it is encapsulated by Grails/GORM respectively hibernate.
Maybe there is a chance if we modify our domain classes thate represent records of the database ?
Thank you for your help.
Robert Nimax
|
Well, I changed the properties of the domain from java.util.Date to java.sql.Timestamp, but we have the same problem now. Maybe hibernate does not use PreparedStatement.setTimestamp(int parameterIndex, Timestamp x, Calendar cal) ?
|
Please download the latest package, you can try timezone=local connection property.
|