Falha na aquisição do bloqueio do banco de dados e hsqldb

Eu estava tentando conectar a um banco de dados hsql. Eu criei um executando a partir de C: \ myhsql:

java -cp .;C:\hsql\lib\hsqldb.jar org.hsqldb.Server -database.0 file:db\mydb -dbname.0 MYDB

Isso crioumydb em um diretório chamadodb. Esta pasta agora possui um arquivo .lck, tmp, script, arquivos de propriedades com o nome mydb e arquivos semelhantes com o nome MYDB na pasta atual.

No código java eu tentei

Class.forName("org.hsqldb.jdbcDriver");
connection = DriverManager.getConnection("jdbc:hsqldb:file:db/sjdb", "SA", "");

Quando executo o programa, estou recebendo este erro:

java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@f3811c1a[file =C:\myhsql\db\mydb.lc
k, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2010-10-19 12:46:09 heartbeat - read: -6750 ms.
...

Aqui está o stacktrace:

java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@f3811c1a[file =C:\myhsql\db\sjdb.lc
k, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2010-10-19 12:46:09 heartbeat - read: -6750 ms.
        at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
        at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
        at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
        at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
        at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at ConnectHSQLDB.main(ConnectHSQLDB.java:20)
Caused by: org.hsqldb.HsqlException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@f3811c1a[file =C:\myhsql\db\sjdb.lck, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2010-10-19 12:46:09 heartbeat - read: -6750 ms.
        at org.hsqldb.error.Error.error(Unknown Source)
        at org.hsqldb.persist.LockFile.newLockFileLock(Unknown Source)
        at org.hsqldb.persist.Logger.acquireLock(Unknown Source)
        at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
        at org.hsqldb.Database.reopen(Unknown Source)
        at org.hsqldb.Database.open(Unknown Source)
        at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
        at org.hsqldb.DatabaseManager.newSession(Unknown Source)
        ... 6 more
java.lang.NullPointerException
        at ConnectHSQLDB.main(ConnectHSQLDB.java:32)

Alguém pode me dizer o que estou fazendo de errado? Posso me conectar ao banco de dados usando o SwingDBManager e possoinsert, deleteeselect registros no banco de dados. Eu não estava executando o DBManager quando tentei o código java. Ainda o problema de bloqueio acontece.

questionAnswers(7)

yourAnswerToTheQuestion