We\'re using hdsqldb in memory to run junit tests which operate against a database. The db is setup before running each test via a spring configuration. All works fine. Now
The above accepted answer works perfectly only if the database name, username and password is untouched (testdb, SA, blank password).
For custom database name, username and password you will get the following exception
java.sql.SQLInvalidAuthroizationSpecException: invalid authorization specification - not found: SA
Then, you have to connect manually.
To connect directly to a non "default" DB use the following snippet
org.hsqldb.util.DatabaseManager.main(new String[] {
"--url", "jdbc:hsqldb:mem:yourdbname", "--noexit",
"--user", "dbusername", "--password", "dbpassword"
});
or for the improved Swing version
org.hsqldb.util.DatabaseManagerSwing.main(new String[] {
"--url", "jdbc:hsqldb:mem:yourdbname", "--noexit",
"--user", "dbusername", "--password", "dbpassword"
});
Before executing the above snippet update the following