Hi, we are using Hibernate 2.1.2 with DB/2 8.1.3 with IBM's Universal Type 4 driver (db2jcc.jar).
We have a piece of code which does this:
Query q = session.createQuery("from Foobar f where f.dateCreated > :date");
q.setDate("date", new Date());
This gives us a -301 Type Mismatch error. The dateCreated column type is TIMESTAMP. If I change the Date to a java.sql.Date or a java.sql.Timestamp, neither works. If I write some pure JDBC code, I can get it to work if I call setTimestamp() on the preparedStatement instead of setDate().
Is there any sort of workaround here to get this working in Hibernate? I'm using the standard DB2Dialect, is there a better dialect to use that might have this fixed?
mike
|