Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

This article is just starting.

Starting

Script,

#!/bin/bash
cd /opt/hsqldb
# Add date to nohup.out file which is automatically created by the nohup command to capture any output from commands sent to it
echo $(date) >nohup.out
# Assuming that java is the the class path.
# Execute Java program calling class path where -cp identifies classpath and,
# Creates a database file called BonsaiFrameworkResourceBundleDatabase if it does not exist relative to the current directory
# -dbname.0 designates that the database will be called BonsaiFrameworkResourceBundleDatabase
# Sends Java program to background and to not terminate via nohup command.
nohup java -cp lib/hsqldb.jar org.hsqldb.Server -database.0 file:data/BonsaiFrameworkResourceBundleDatabase -dbname.0 BonsaiFrameworkResourceBundleDatabase &

For some reason the script requires the user to hit an extra return. I believe this is due to the nohup command. Investigate and resolve.

From the HSQLDB manual it provides this example,

# Make an environment variable called CLASSPATH
export CLASSPATH
# Set CLASSPATH to include the hsqldb.jar file. Java will look at CLASSPATH list to know what to execute.
CLASSPATH=/path/to/hsqldb/lib/hsqldb.jar
# Executes Java program calling class and sends to background.
nohup java org.hsqldb.Server &

Stopping

Script,

cd /opt/hsqldb
java -jar lib/hsqldb.jar --sql "shutdown;" --rcFile ./sqltool.rc localhost-sa

versus HSQLDB manual.

Resources

http://hsqldb.org/doc/2.0/guide/unix-chapt.html - start here and simplify these instructions.

  • No labels