3. Installation

3.1. C-JDBC Controller

3.1.1. Using the Java graphical installer

The easiest way to install C-JDBC is to use the Java graphical installer. A Java Virtual Machine is of course needed in this case.

  • Unix users can simply launch the installation program by typing:

     
                  bash> java -jar c-jdbc-x.y.bin-installer.jar 
                
  • Windows users can use the same command or just double-clik on the JAR installation file if your JRE has been properly installed.

3.1.2. Using the binary distribution

If you want to use the other distribution formats (for example if you have not installed a JVM or if you can not launch a graphical application), you have to uncompress the downloaded file in the directory of your choice, and then set the CJDBC_HOME environment variable.

[Note]Note

If you are using the Java installer, you do not need to set any environment variable since the installer customizes the scripts with the installation path.

To set the CJDBC_HOME environment variable, you can proceed as follows:

  • Unix users can proceed as follows:

     
    bash> mkdir -p /usr/local/c-jdbc
    bash> cd /usr/local/c-jdbc
    bash> tar xfz /path-to-c-jdbc-bin-dist/c-jdbc-x.y-bin.tar.gz
    bash> export CJDBC_HOME=/usr/local/c-jdbc
                
    [Note]Note

    In this example, we assume you install C-JDBC in the /usr/local/c-jdbc directory.

    You can modify your shell configuration file (.bashrc, .cshrc, ...) to set the environment variable permanently.

  • Windows users have to use an utility such as WinZip to extract the files from the archive. Then, to set the CJDB_HOME variable, do the following according to your Windows version:

    • Windows 95 or 98: you must insert the following line in the AUTOEXEC.BAT file:

      set CJDBC_HOME="C:\Program Files\C-JDBC"
    • Windows Me: go to the “Start Menu”, then choose “Programs”, “Accessories”, “System Tools” and “System Information”. A window titled “Microsoft Help and Support” should appear. Select the “Tools” menu, and choose the “System Configuration Utility”. Go to the “Environment” and click on the “New” button. Enter CJDBC_HOME in the “Variable Name” field and "C:\Program Files\C-JDBC" in “Variable Value”. Once you have changed and saved the value, you will be prompted for reboot.

    • Windows NT: go to the “Start Menu”, then choose “Settings”, “Control Panel” and select “System”. Select the “Environment” tab and click on the “New” button. Enter CJDBC_HOME in the “Variable Name” field and "C:\Program Files\C-JDBC" in “Variable Value”.

    • Windows 2000: go to the “Start Menu”, then choose “Settings”, “Control Panel” and select “System”. Select the “Advanced” tab and click on the “New” button. Enter CJDBC_HOME in the “Variable Name” field and "C:\Program Files\C-JDBC" in “Variable Value”.

    • Windows XP: go to the “Start Menu”, then double click on “System”. In the “System Control Panel” select the “Advanced” tab and push the Environment Variables button. Click on the “New” button for “System Variables”. Enter CJDBC_HOME in the “Variable Name” field and "C:\Program Files\C-JDBC" in “Variable Value”.

    [Note]Note

    In this example, we assume you install C-JDBC in the C:\Program Files\C-JDBC directory.

    [Note]Note

    Do not forget the quotes in the CJDBC_HOME environment variable definition else the starting scripts will fail with paths including spaces.

3.2. C-JDBC Driver

Once you have installed the C-JDBC controller, you will find the driver JAR file in the drivers/ directory of the controller installation location.

To install the C-JDBC driver, you just have to add the c-jdbc-driver.jar file to the client application classpath. This driver replaces the database native driver in the client application. The database native driver will be used by the C-JDBC controller to access your database. Therefore, the C-JDBC driver and controller can be seen as a proxy between your application and your database native driver.

3.3. C-JDBC out of the box

Since version 1.0b13, you have access to a RAIDb-1 configuration of HyperSonic SQL databases, just by launching the demo-raidb1.sh or demo-raidb1.bat file from the demo directory in your C-JDBC installation.

This is especially useful if you are new to clustering, or new to C-JDBC. The setup used is as follows:

  • 2 HyperSonic SQL databases are started on two different ports (9001 and 9002)

  • An extra HyperSonic SQL database is started on port 9003 to be used as the recovery log database

  • The C-JDBC controller is configured to load automatically a virtual database containing those two HyperSonic SQL backends. The controller startup configuration file is found in CJDBC_HOME/config/controller/controller-raidb1.xml and the virtual database configuration file is CJDBC_HOME/config/virtualdatabase/hsqldb-raidb1.xml.

  • Once the RAIDb-1 configuration is loaded, you can connect to C-JDBC using Squirrel, a graphical SQL console bundled with C-JDBC. You can start Squirrel by using squirrel.sh or squirrel.bat.

Squirrel shows the C-JDBC driver and HSQL database driver, and links to databases. You can click on them to view the different data. The login to use for C-JDBC is user with an empty password. The login for both HSQL databases is test with an empty password.