Database lock acquisition failure and hsqldb

前端 未结 8 2052
终归单人心
终归单人心 2020-12-30 00:00

I was trying to connect to a hsql db. I created one by running from C:\\myhsql:

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


        
8条回答
  •  伪装坚强ぢ
    2020-12-30 00:16

    The first command starts a server. This server locks the database files so that "others" cannot modify them. You should use "-dbname.0 mydb" instead of "MYDB" as it should be in lowercase.

    Your Java connection URL to connect to the database is wrong. You should use "jdbc:hsqldb:hsql://localhost/mydb" as the connection string. While the database files are locked by the server, you can access the database server but you cannot access the database "in-process" with a file: URL.

提交回复
热议问题