Database lock acquisition failure and hsqldb

前端 未结 8 2185
终归单人心
终归单人心 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:33

    You can access HSQLDB database that has lock by:

    1- updating my-db-name.properties file and add:

    hsqldb.lock_file=false
    

    2- or removing my-db-name.lck file.

    3- or connect to the database using pass the properties as parameters:

    #Without Sqltool:
        java -cp [jar-path]/hsqldb-2.4.0.jar --inlineRc=url=jdbc:hsqldb:file:/[my-db-file-path]/[db-name];readonly=true;hsqldb.lock_file=false,user=sa
    
    #With Sqltool
        java -cp [jar-path]/hsqldb-2.4.0.jar:[jar-path]/sqltool-2.4.0.jar org.hsqldb.cmdline.SqlTool --inlineRc=url=jdbc:hsqldb:file:/[my-db-file-path]/[db-name];readonly=true;hsqldb.lock_file=false,user=sa
    

    Other HSQLDB database parameters can be found here, however note that only few of them can be updated after first time. http://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html

提交回复
热议问题