For connecting to in-memory HSQL database, we need to launch a db browser in the same JVM instance.
First, we need to add the following code in a Configuration class of the Spring application.
@PostConstruct
public void startDBManager() {
//hsqldb
DatabaseManagerSwing.main(new String[] { "--url", "jdbc:hsqldb:mem:testdb", "--user", "sa", "--password", "" });
}
Then, we need to add the following VM arguments -Djava.awt.headless=false
when the application is started