HSQLDB, the famous fast RDBMS written in Java, introduced a new feature which affects code ported over from previous versions. From version 1.7.2, in-process databases are no longer closed when the last connection to the database is explicitly closed via JDBC. Effectively your data is not written to disk even if you exit the program (say for database opened within application). Also it prevents opening the database next time around as a lock file (.lck) has been created to indicate that the data has not been commited to disk. There are two solutions to this issue.

You can either issue an explicit SHUTDOWN command through executeQuery. It will effectively shutdown the database and commit all data to disk.

A simpler way is to slightly alter your DriverManager.getConnection statement to ensure the database is closed after the last connection has been closed. This is what I use -
DriverManager.getConnection("jdbc:hsqldb:file:" + database + ";shutdown=true", "sa", "");