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
- Download Apache Derby and install it.
tar -xzf db-derby-10.5.1.1-bin.tar.gz
mv db-derby-10.5.1.1-bin /opt/Apache/derby
- 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.
- Download 'vcl.sql' file and the 'derby-parser.pl'.
The 'derby-parser.pl' can be found as an attachment to this page and 'vcl.sql' fron repositories.
Edit the file 'derby-parser.pl'. the variables corresponding to the 'user' and 'password' should match your database.
svn export https://svn.apache.org/repos/asf/vcl/trunk/mysql/vcl.sql
chmod a+x derby-parser.pl
- 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
- Install log4j
tar -zxf apache-log4j-1.2.15.tar.gz
mv apache-log4j-1.2.15 /opt/Apache/derby/lib/
- When installing the perl modules using the 'install_perl_libs.pl' (/usr/local/vcl/bin/install_perl_libs.pl) two extra modules need to the installed for Derby. Open the file 'install_perl_libs.pl' and in the list of modules to download add the following two modules.
- Run the scrips as normal
- 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/log4j.properties /opt/Apache/derby/lib/apache-log4j-1.2.15
- Create a script file which will launch the dbd_jdbc Server. Save it under any name and directory (e.g. /opt/server.sh), only remember that this scrips needs to be executed every time you start up the server. The file should contain
Note1: if some of your paths are different you need make the changes in this scrips file as well
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 &
Note2: currently port 12345 is used for connecting to Derby, this is hard coded. Can be changed on a later stage.
- Make the script executable
- Start the Server