Search code examples
spring-bootintellij-ideahsqldb

Connect to existing hsqldb instance in IDE


I am learning Spring Boot using open-source projects and have stumbled upon their demo project — PetClinic. It has two possible databases configured: MySQL & HSQLDB, it uses the latter by default. So I was able to launch the project look at it on localhost and can see that the DB (HSQLDB) is being populated but I was unable to set up a connection through the Intellij IDEA because the project does not specify the path that allows to see the contents of this in-memory DB.

screenshot

Can anyone please tell me, what am I missing in the process of establishing the connection to HSQLDB here? Thanks!


Solution

  • You can't connect to an in-memory instance of HSQLDB from another process.

    The main drawback [of in-memory mode] is that it is not possible by default to connect to the database from outside your application. As a result you cannot check the contents of the database with external tools such as Database Manager while your application is running.

    If you want to do this, you need to run HSQL as a server. More details about how to run it in server mode can be found here.