Reputation: 1167
I'm currently developing a java desktop application using netbeans + hibernate + hsqldb in embedded mode.
While creating a new database I got this exception: Cannot establish a connection to jdbc:hsqldb:hsql://localhost using org.hsqldb.jdbcDriver (java.net.ConnectException: Connection refused: connect)
Upvotes: 3
Views: 14289
Reputation: 24382
The URL jdbc:hsqldb:hsql://localhost
is for access to an HSQLDB server running on the local machine. If you want to use HSQLDB this way, your application must start this server before connecting to it. The client/server method of access is actually a good idea for developing the application, because you can access the server from outside your app at the same time.
For development, you can start the server outside your app from the command line. The server can keep running when you restart the app.
The URL for an embedded mode database with files is jdbc:hsqldb:file:<your file path>
and is documented in the HSQLDB Guide.
Upvotes: 7