Hibernate生成映射文件及POJO出现的oracle驱动版本问题

本人在使用Hibernate生成映射文件及POJO时遇到的问题:“org.hibernate.exception.GenericJDBCException: Could not get list of tables from database. Probably a JDBC driver problem.

版本信息:Hibernate3.1 ;MyEclipse6.0M1; Oracle8。

查看Eclipse workspace\.metadata\.log文件产生如下日志信息:

!ENTRY org.eclipse.core.jobs 4 2 2007-08-13 14:01:59.546
!MESSAGE An internal error occurred during: "Generating Artifacts".
!STACK 0
org.hibernate.exception.GenericJDBCException: Could not get list of tables from database. Probably a JDBC driver problem.
Configured schema:ALDB
Configured catalog:null
Available schemas:
  ADAMS
  ALDB
  AURORA$JIS$UTILITY$
  AURORA$ORB$UNAUTHENTICATED
  BLAKE
  CLARK
  CTXSYS
  DBSNMP
  JONES
  MDSYS
  MTSSYS
  ORDPLUGINS
  ORDSYS
  OSE$HTTP$ADMIN
  OUTLN
  SCOTT
  SYS
  SYSTEM
Available catalogs:

 at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
 at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.handleSQLException(JDBCMetaDataDialect.java:40)
 at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:62)
 at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:433)
 at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:67)
 at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:104)
 at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:89)
 at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:137)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$7.execute(GenerateArtifactsJob.java:827)
 at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
 at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:811)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:381)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.sql.SQLException: Invalid column name
 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
 at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:4383)
 at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:667)
 at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)
 at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:33)
 at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:59)
 ... 11 more

解决思路:按照提示信息描述的Probably a JDBC driver problem.开始更换OracleJDBCDriver classess12的各种版本,由于数据库版本为8使用8的驱动明显不行,逐渐升高版本至(10.2.0.3) 问题便解决了。可以到这个地址下载最新的Oracle驱动程序http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html

你可能感兴趣的:(java,eclipse,oracle,Hibernate,jdbc)