Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

I am not entirely happy with the stop and start scripts and also not done picking apart the example provided by hsqldb and explaning the reasoning behind our own custom script.

Introduction

Warning

Explain what HSQLDB is about.

Setup

Warning

To fill in, though it's pretty simple.

\

Starting

Script,

Code Block
languagebash
#!/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 BonsaiResourceBundleDatabase if it does not exist relative to the current directory
# -dbname.0 designates that the database will be called BonsaiResourceBundleDatabase
# 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/BonsaiResourceBundleDatabase -dbname.0 BonsaiResourceBundleDatabase &

# Without this echo, the script will require that the user hit enter to return back to the command line
echo "hsqldb started"

...

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

versus HSQLDB manual.

Backup

Warning

Start from really simple, using tar, to using script and then advanced using replication.

Resources

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