2

The JPA 2.0 Provider Hibernate is throwing exception while preparing configuration for entity manager factory, I am using DB2 v9.5 database and DB2 v9.5 JDBC type 2 driver .

java.sql.SQLException: [IBM][JDBC Driver] CLI0626E  getDatabaseMajorVersion is not supported in this version of DB2 JDBC 2.0 driver.
 at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throwNotSupportedByDB2(Unknown Source)
 at COM.ibm.db2.jdbc.app.DB2DatabaseMetaData.getDatabaseMajorVersion(Unknown Source)
 at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:117)
 at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
 at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
 at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)
 at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
1
  • Can you confirm the JDBC version and type of the driver? It seems like you are mixing "type" and "version". DB2 is well tested with JDBC driver Type 4 (100% Java) and JDBC 3.0+. Please, provide the output for the following command: java com.ibm.db2.jcc.DB2Jcc -version Commented Jan 4, 2011 at 12:18

1 Answer 1

1

From looking at the code: there is an undocumented hibernate.temp.use_jdbc_metadata_defaults property, setting it to false may help if you can't change JDBC driver:

<property name = "hibernate.temp.use_jdbc_metadata_defaults" value = "false" />
3
  • Thanx, Found this hibernate experimental code; these experimental code makes open source unworkable without source code. Commented Jan 7, 2011 at 12:54
  • can you let us know what exactly this property does as far as hibernate is concerned?
    – SibzTer
    Commented Mar 24, 2011 at 14:03
  • @SibzTer: It disables the call of the offending method. I didn't examined it thoroughly, take a look at the source of SettingsFactory.
    – axtavt
    Commented Mar 24, 2011 at 15:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.