Using Hibernate 3.3.1, after migration from DB2 V8 to DB2 V9, I had the following warning message from class
com.ibm.db2.jcc.a.SqlException: DatabaseMetaData information is not known for server DB2/NTSQL09050 by this version of JDBC driver
at com.ibm.db2.jcc.a.p.supportsResultSetType(p.java:5158)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDatabaseMetaData.supportsResultSetType(WSJdbcDatabaseMetaData.java:2919)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:80)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
...
The solution would probably to use a new SQL driver adapted to DB2 V9, but in the meantime, I found a workaround while reading SettingsFactory.java.
Workaround is: you simply need to define the following property in the persistence.xml:
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
This problem/solution is also found here:
http://forums.sun.com/thread.jspa?threadID=5137610http://forums.sun.com/thread.jspa?threadID=5368052Note: this solution does probably not work for
https://forum.hibernate.org/viewtopic.php?f=6&t=995595 because the property is not used.