0

I have installed Java 8 and I have the SchemaCrawler folder on E: on my machine. I run SQL Server 2012.

The cmd command used is below

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 %*

I have checked the suggestions given here but no luck . I still get the below error

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
Community
  • 1
  • 1
mhn
  • 2,660
  • 5
  • 31
  • 51

1 Answers1

1

You are using SchemaCrawler for HyperSQL. Please download and use SchemaCrawler for SQL Server instead.

Sualeh Fatehi, SchemaCrawler

Sualeh Fatehi
  • 4,700
  • 2
  • 24
  • 28
  • Sorry.. My bad there was a misleading download latest version link there. Will try with the actual file – mhn Nov 06 '14 at 19:24
  • Now, although it generates a PDF, the pdf is empty. Am I missing any parameter in the cmd command? – mhn Nov 06 '14 at 19:41
  • 1
    First try without the -schemas: sc.cmd -c graph -host=10.52.136.168 -user=sa -database=MyDBName schemacrawler.Main -infolevel=standard -outputformat=pdf -outputfile=database-diagram.pdf then, use something like -schemas=MyDBName.dbo – Sualeh Fatehi Nov 06 '14 at 20:22
  • 1
    Voila! I used -schemas=MyDBName.dbo and it worked! It is much more readable than the default MSSQL diagram! Thanks! – mhn Nov 07 '14 at 06:15
  • Also, an additional change made was to append path variable as mentioned at http://www.graphviz.org/content/failed-run-dot for Graphviz – mhn Nov 07 '14 at 06:16