无法使用Schemacrawler连接到MSSQL

时间:2014-11-06 13:27:56

标签: java sql-server schemacrawler

我已经安装了Java 8,并且在我的机器上的E:上有SchemaCrawler文件夹。我运行SQL Server 2012.

使用的cmd命令位于

之下
sc.cmd -c graph -host=10.52.136.168  -user=sa -database=MyDBName schemacrawler.Main -infolevel=detailed -schemas=dbo -tabletypes=TABLE -outputformat=pdf -outputfile=database-diagram.pdf %*

我查看了here给出的建议 但没有运气。我仍然得到以下错误

schemacrawler.schemacrawler.SchemaCrawlerSQLException: Could not connect to jdbc
:hsqldb:hsql://10.52.136.168:9001/DeliveryIntelligence;readonly=true;hsqldb.lock
_file=false, with properties {user=sa}
        at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnecti
on(BaseDatabaseConnectionOptions.java:122)
        at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnecti
on(BaseDatabaseConnectionOptions.java:70)
        at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.execute(Sche
maCrawlerCommandLine.java:176)
        at schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerM
ain.java:78)
        at schemacrawler.tools.hsqldb.Main.main(Main.java:43)
Caused by: java.sql.SQLTransientConnectionException: java.net.ConnectException:
Connection refused: connect
        at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
        at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
        at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
        at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
        at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnecti
on(BaseDatabaseConnectionOptions.java:115)
        ... 4 more
Caused by: org.hsqldb.HsqlException: java.net.ConnectException: Connection refus
ed: connect
        at org.hsqldb.ClientConnection.openConnection(Unknown Source)
        at org.hsqldb.ClientConnection.initConnection(Unknown Source)
        at org.hsqldb.ClientConnection.<init>(Unknown Source)
        ... 10 more
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at org.hsqldb.server.HsqlSocketFactory.createSocket(Unknown Source)
        ... 13 more

1 个答案:

答案 0 :(得分:1)

您正在使用SchemaCrawler for HyperSQL。请下载并使用SchemaCrawler for SQL Server代替。

Sualeh Fatehi,SchemaCrawler