0

How can I stop a running HSQLDB server instance from the shell (e.g. as part of a shell script)?

user149408
  • 5,385
  • 4
  • 33
  • 69

1 Answers1

0

Try the following. Replace dbname with the name of your database and change credentials if necessary, and adjust the classpath to your system as needed:

java -cp $CLASSPATH:/usr/share/java/hsqldbutil.jar:/usr/share/java/hsqldb.jar "org.hsqldb.cmdline.SqlTool" --inlineRc=url=jdbc:hsqldb:hsql://localhost/dbname,user=SA,password= --sql="SHUTDOWN;"

If your distro comes with a shell script wrapper for SQL Tool, you can shorten that as:

hsqldb-sqltool --inlineRc=url=jdbc:hsqldb:hsql://localhost/dbname,user=SA,password= --sql="SHUTDOWN;"

Instead of using --inlineRc you can also build an rcfile with the parameters you need and specify that.

user149408
  • 5,385
  • 4
  • 33
  • 69