Using HSQLDB in the embedded mode
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.
Related videos on Youtube
Comments
-
nawara almost 2 years
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)
-
nawara over 10 yearsyes and the file in the embedded mode should respect the hsqldb architecture what is better for a swing app server/embedded mode ?
-
zygimantus almost 7 yearsWhat URL should be used if the property in Java app is
jdbc:hsqldb:mem:testdb
? -
fredt almost 7 years
jdbc:hsqldb:mem:testdb
itself is a URL for memory-only databases.