Using HSQLDB in the embedded mode

11,649

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.

http://hsqldb.org/doc/

Share:
11,649

Related videos on Youtube

nawara
Author by

nawara

Engineering student

Updated on June 04, 2022

Comments

  • nawara
    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)

    enter image description here

  • nawara
    nawara over 10 years
    yes and the file in the embedded mode should respect the hsqldb architecture what is better for a swing app server/embedded mode ?
  • zygimantus
    zygimantus almost 7 years
    What URL should be used if the property in Java app is jdbc:hsqldb:mem:testdb?
  • fredt
    fredt almost 7 years
    jdbc:hsqldb:mem:testdb itself is a URL for memory-only databases.