Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Starting and stopping and running the HSQLDB

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Starting and stopping and running the HSQLDB


Chronological Thread 
  • From: Tom Barton <>
  • To: Curt Blank <>
  • Cc: Grouper Users <>
  • Subject: Re: [grouper-users] Starting and stopping and running the HSQLDB
  • Date: Thu, 26 Apr 2007 07:17:19 -0500

HSQLDB has a command line interface that can be used to automate its operations. Just fyi, below is a script I use to start/stop the prototype databases on my laptop. You may need to browse through the HSQLDB documentation once to get your scripts doing exactly as you want.

Tom

Curt Blank wrote:
How is this suppose to be done? I'm using the quickstart, when I do an "ant db" it ties up my session. it then says connect up to shutdown, using what to connect?

How does one start this db in daemon mode like any other normal application like at system boot and not tie up a terminal session? And then how does the system shut it down at system shutdown? I'm talking /etc/init.d stuff.

Tying up a terminal session when it's running and having to connect to it in an unknown way doesn't seem real efficient. Not like the normal S50hsqldb and K10hsqldb ways.

-Curt Blank

DB0="groups"
DB1="privs"
DB2="groups12"

case "$1" in
startall)
java -cp hsqldb.jar org.hsqldb.Server \
-database.0 $DB0 \
-dbname.0 $DB0 \
-database.1 $DB1 \
-dbname.1 $DB1 \
-database.2 $DB2 \
-dbname.2 $DB2 \
-user sa &
;;
startgroups)
java -cp hsqldb.jar org.hsqldb.Server \
-database.0 $DB0 \
-dbname.0 $DB0 \
-database.2 $DB2 \
-dbname.2 $DB2 \
-user sa &
;;
startprivs)
java -cp hsqldb.jar org.hsqldb.Server \
-database.1 $DB1 \
-dbname.1 $DB1 \
-user sa &
;;
stopall)
java -jar hsqldb.jar --sql "shutdown;" --rcfile ./sqltool.rc $DB0
java -jar hsqldb.jar --sql "shutdown;" --rcfile ./sqltool.rc $DB1
java -jar hsqldb.jar --sql "shutdown;" --rcfile ./sqltool.rc $DB2
;;
stopgroups)
java -jar hsqldb.jar --sql "shutdown;" --rcfile ./sqltool.rc $DB0
java -jar hsqldb.jar --sql "shutdown;" --rcfile ./sqltool.rc $DB2
;;
stopprivs)
java -jar hsqldb.jar --sql "shutdown;" --rcfile ./sqltool.rc $DB1
;;
dbm)
java -cp hsqldb.jar org.hsqldb.util.DatabaseManagerSwing &
;;
*)
echo "reg.sh [startall|stopall|dbm|startgroups|stopgroups|startprivs|stopprivs]"
;;
esac



Archive powered by MHonArc 2.6.16.

Top of Page