JPA 2.0 Provider Hibernate 3.6 for DB2 v9.5 type 2 driver is throwing exception in configuration prepration(JPA 2.0 Provider Hibernate 3.6 for DB2 v9.5 type 2 驱动程序在配置准备中抛出异常)
问题描述
JPA 2.0 Provider Hibernate 在为实体管理器工厂准备配置时抛出异常,我使用的是 DB2 v9.5 数据库和 DB2 v9.5 JDBC type 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)
推荐答案
看代码:有一个未记录的hibernate.temp.use_jdbc_metadata_defaults
属性,设置为false如果您无法更改 JDBC 驱动程序,code> 可能会有所帮助:
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" />
这篇关于JPA 2.0 Provider Hibernate 3.6 for DB2 v9.5 type 2 驱动程序在配置准备中抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:JPA 2.0 Provider Hibernate 3.6 for DB2 v9.5 type 2 驱动程序在配置准备中抛出异常
基础教程推荐
- 如何使用 Java 创建 X509 证书? 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 降序排序:Java Map 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01