WARN SettingsFactory:140 - Could not obtain connection metadata

                                          SSH2环境搭建常见问题解决


SSH2环境搭建过程中,数据库连接池连接报错信息:

19:26:49,454  WARN DTDEntityResolver:73 - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
19:26:49,752  WARN SettingsFactory:140 - Could not obtain connection metadata
java.sql.SQLException: 不支持的特性
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
	at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
	at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4442)
	at com.mchange.v2.c3p0.impl.NewProxyDatabaseMetaData.getDatabaseMajorVersion(NewProxyDatabaseMetaData.java:3678)
	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.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
	at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
解决方案:下载ojdbc14.jar并替换原来的classes12.jar。

报错原因:我原来用的是 classes12.jar的驱动,相对Hibernate3来说版本太低了。


你可能感兴趣的:(WARN SettingsFactory:140 - Could not obtain connection metadata)