Chapter 3. Configuring Luntbuild to use database

Table of Contents

HSQL database
MySql database
PostgreSQL database
SqlServer
Oracle
Derby
H2
Updating database during Luntbuild upgrade

Luntbuild uses a database to make important Luntbuild data persistent. It uses ORM package Hibernate to access the persistent data and as a framework to access a database.

HSQL database

Luntbuild uses HSQL DB as default database running inside Luntbuild (in process mode). Additional in process (embedded) database supported by Luntbuild is H2. Luntbuild also supports following external (client/server mode) databases:

MySql
ProgreSql
SqlServer
Oracle
Derby
H2

For external (client/server mode) databases, you will have create initial Luntbuild database by executing SQL scripts in appropriate db/... subdirectories.

Database definitions and data are located in the db directory of the Luntbuild installation.

HSQL DB uses db/luntbuild.script to define DB layout. Following files are also used, see HSQL DB documentation:

db/luntbuild.data
db/luntbuild.bakup

H2 embedded database uses luntbuild-h2-data* files located in db directory.

Sometimes, it is useful to look at the data in the DB to find out issues. Following are the steps to run a SQL client to examine data in the HSQL DB:

Download HSQLDB 1.7.3.3 from www.hsqldb.org. (Latest version 1.8.0 should also work)
Extract the downloaded package.
Change into the demo folder, edit the file "runServer.bat", replace the original contents with this line:

@java -classpath ../lib/hsqldb.jar org.hsqldb.Server -database <db path>

<db path> should be replaced with your path to Luntbuild DB. For example, if you are installing Luntbuild in D:\luntbuild, you should specify <db path> as D:\luntbuild\db\luntbuild.

Run "runserver.bat" to start up the database server.
Run "runManager.bat", from the popup dialog, select "HSQL Database Engine Server" as "Type" option, then you'll able to run SQL commands to examine contents of the DB.

If you are using Eclipse you can use DB plugin Quantum DB and the set the connection:

Table 3.1. QuantumDB HSQL DB Eclipse Configuration

ParameterValue
Jdbc Urljdbc:hsqldb:file:D:\luntbuild-13alpha\db\luntbuild
Usersa
Password 
Driver Path<app-server>/webapps/luntbuild/WEB-INF/lib/hsqldb.jar
Driver Classorg.hsqldb.jdbcDriver
Driver TypeHSQL (Hypersonic)

[Note]Note

Many Luntbuild tables contain binary data which can not be displayed through the client, for example, if you run command "select * from LB_BUILD", nothing will be displayed. You should only specify non-binary columns here, for example, "select LB_ID, LB_NAME from LB_BUILD", etc.