Hibernat:用Middlegen hibernate连接ORACLE数据库时出错!

      small 2005-9-23 15:56
用Middlegen hibernate连接ORACLE9i!
运行ANT后,出现如下错误:
C:\Hibernate\build.xml:148: middlegen.MiddlegenException: Middlegen successfully connected to the da
tabase, but couldn't find any tables. Perhaps the specified schema or catalog is wrong? -Or maybe th
ere aren't any tables in the database at all?

解决办法:
ORACLE.xml文件中:
<property name="database.userid" value="a"/>
<property name="database.password" value="a"/>
<property name="database.schema" value="A"/>
其中最后一项一定要填写,不然就会报上面的错
<property name="database.schema" value="A"/>
value值一般为userdi的大写形式。


/////////////////////////////////////////////////////////////////////////
用Middlegen hibernate连接MSSQL2000时出现如下错误:
middlegen.MiddlegenException: Couldn't connect to database: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.

mssql.xml如下:
<property name="database.script.file" value=""/>
<property name="database.driver.file" value="$ {lib.dir}/mssqlserver.jar"/>
<property name="database.driver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<property name="database.url" value="jdbc:microsoft:sqlserver://localhost:1433;database=Flat"/>
<property name="database.userid" value="sa"/>
<property name="database.password" value="123"/>
<property name="database.schema" value="dbo"/>
<property name="database.catalog" value="Flat"/>

<property name="jboss.datasource.mapping" value="MS SQLSERVER"/>


解决方法:安装MSSQL Server2000 sp3补丁后就不会出现此错误了,且运行正常!
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}