日期:2014-05-20  浏览次数:20704 次

学习hibernate时的问题
一.我用sql   server   2000建了一个数据库FileManagement并在其中建表client,   开发工具是Myeclipse创建了web工程并通过add   hibernate   compablities生成了hibernate.cfg.xml文件,内容是这样的:
    <hibernate-configuration>

        <session-factory>
                <property   name= "connection.url "> jdbc:odbc:FileManagement </property>
                <property   name= "dialect "> org.hibernate.dialect.SQLServerDialect </property>
                <property   name= "myeclipse.connection.profile "> aaaa </property>
                <property   name= "connection.driver_class "> sun.jdbc.odbc.JdbcOdbcDriver </property>
       
        <session-factory>

    </hibernate-configuration>  

二.右击FileManagement中的client表并执行hibernate   reverse   engineering是发生错误:an   internal   error   occurred   during   "generating   artifacts   "。查看.log文件内容如下:
!SESSION   2007-03-15   22:14:47.187   -----------------------------------------------
eclipse.buildId=M20060629-1905
java.version=1.5.0_10
java.vendor=Sun   Microsystems   Inc.
BootLoader   constants:   OS=win32,   ARCH=x86,   WS=win32,   NL=zh_CN
Command-line   arguments:     -os   win32   -ws   win32   -arch   x86

!ENTRY   org.eclipse.wst.internet.cache   1   0   2007-03-15   22:15:12.062
!MESSAGE   wtp.autotest.noninteractive   is   set.   Licenses   dialogs   will   not   be   displayed.

!ENTRY   org.eclipse.core.jobs   4   2   2007-03-15   22:18:19.031
!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:dbo
Configured   catalog:FileManagement
    <SQLException   while   getting   schemas>
    <SQLException   while   getting   catalogs>

at   org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at   org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at   org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.handleSQLException(JDBCMetaDataDialect.java:86)
at   org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:50)
at   org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:400)
at   org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:65)
at   com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:102)
at   org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:87)
at   com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:134)
at   com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$6.execute(GenerateArtifactsJob.java:514)
at   org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)