Using Apache Derby Database

NOTE: The current code in the trunk does not support Derby (21 Aug 2009)


You should have installed:

  • JDK (it is maybe possible to work with jre only)

Downloading and Setting Up the Database for VCL

  1. Download Apache Derby and install it.
    cd ~
    tar -xzf db-derby-
    mkdir /opt/Apache
    mv db-derby- /opt/Apache/derby
    export DERBY_HOME="/opt/Apache/derby"
    export CLASSPATH="${DERBY_HOME}/lib/derby.jar:${DERBY_HOME}/lib/derbytools.jar:${CLASSPATH}"
  2. Create a database in Apache Derby. The database has to be placed in the path /opt/.
    Replace 'vcluser' and 'vcluserpassword' with the user and password you want.
    cd /opt/
    connect 'jdbc:derby:vcl1;create=true;user='vcluser';password='vcluserpassword';';
  3. Download 'vcl.sql' file and the ''.
    The '' can be found as an attachment to this page and 'vcl.sql' fron repositories.
    Edit the file ''. the variables corresponding to the 'user' and 'password' should match your database.
    svn export
    chmod a+x
  4. Import vcl-derby.sql file into database. It is a good idea to direct the output to file and check if there were any errors.
    ij vcl-derby.sql > import.log

Setting up the dbd_jdbc Server

  1. Install log4j
    cd ~
    tar -zxf apache-log4j-1.2.15.tar.gz
    mv apache-log4j-1.2.15 /opt/Apache/derby/lib/
  2. When installing the perl modules using the '' (/usr/local/vcl/bin/ two extra modules need to the installed for Derby. Open the file '' and in the list of modules to download add the following two modules.
  3. Run the scrips as normal
    perl /usr/local/vcl/bin/
  4. Copy some file from the modules to Derby directory
    cp /tmp/perl-modules/DBD-JDBC-0.71/dbd_jdbc.jar /opt/Apache/derby/lib/
    cp /tmp/perl-modules/DBD-JDBC-0.71/ /opt/Apache/derby/lib/apache-log4j-1.2.15
  5. Create a script file which will launch the dbd_jdbc Server. Save it under any name and directory (e.g. /opt/, only remember that this scrips needs to be executed every time you start up the server. The file should contain
    java -Djdbc.drivers=org.apache.derby.EmbeddedDriver -Ddbd.port=12345 -classpath /opt/Apache/derby/lib/derby.jar:/opt/Apache/derby/lib/dbd_jdbc.jar:/opt/Apache/derby/lib/apache-log4j-1.2.15/log4j-1.2.15.jar:/opt/Apache/derby/lib/apache-log4j-1.2.15/  com.vizdom.dbd.jdbc.Server &
    Note1: if some of your paths are different you need make the changes in this scrips file as well
    Note2: currently port 12345 is used for connecting to Derby, this is hard coded. Can be changed on a later stage.
  6. Make the script executable
    chmod a+x /opt/server
  7. Start the Server
  • No labels