RealSQL-JDBC Driver

The RealSQL-JDBC Driver allows JDBC-compliant applications to read and write data to a Reality database using SQL. It includes a standard API that can be used in Java applications, applets and servlets.

Prerequisites

Installation

Windows

  1. Start the installation program as described for Windows in the section Starting the installation.

  2. Select RealSQL-JDBC Driver from the SQL Software menu. Note that JReal is a prerequisite for the JDBC driver; if you have not already installed JReal, this is loaded automatically.

  3. The default location is c:\Program Files\NorthgateIS\RealSQL-JDBC-1.0; you can override this if required.

  4. You can select up to four components: Program Files, Example Files, Help Files and a Test Utility. Highlight an item to display a description of that component.

UNIX

  1. Start the installation program as described for UNIX in the section Starting the installation.

  2. Enter the root password when prompted. The following menu is displayed:

    Reality CD-ROM Component Installation Utility

    Select component to install
    Install JDBC driver y/n/q [n]:
    Install JReal y/n/q [n]:
    Install RealWeb y/n/q [n]:
  3. Enter y to select the required components. Note that JReal is a prerequisite for the JDBC driver; if you have not already installed JReal, this is loaded automatically.

    About to install .........   Confirm?

    Enter y to continue.

  4. Enter the installation directory for each component when prompted. For JReal and the JDBC Driver, the default location is /usr/northgateis/Product-Version, but you can change this if required.

Set-up after installation

On the Host System

Setting up the host for use with RealSQL-JDBC is the same as for On the Host System.

On the Client

Adding Files to CLASSPATH

  1. Set up the CLASSPATH environment variable for JReal.

  2. Add the realsql-jdbc.jar file to the CLASSPATH. For example, on UNIX:

    /usr/northgateis/RealSQL-JDBC-1.0/realsql-jdbc.jar

    or on Windows:

    C:\Program Files\NorthgateIS\RealSQL-JDBC-1.0\realsql-jdbc.jar
  3. If you want to run the Test Utility, you must also add the RealJTest file to CLASSPATH. On UNIX:

    /usr/northgateis/RealSQL-JDBC-1.0/RealJTest

    or on Windows:

    C:\Program Files\NorthgateIS\RealSQL-JDBC-1.0\RealJTest

    For information on how to set CLASSPATH, refer to Setting Environment Variables.

Testing a Connection to a Reality Database

Once you have installed and configured the SQL/JDBC software, you should check that you can connect to a Reality database. On Windows, the installation procedure places a shortcut to a program called RealJTest on your desktop. In UNIX, you can run RealJTest by entering the command java RealJTest.

Enter the following information:

When you have entered all this information, click the Connect button. The title of the Connect button should change to Disconnect and the connect string should be displayed beside the Disconnect button.

Once you are connected, you can enter SQL statements into the Command text area. When you click the Execute button, these will be executed and the results displayed in the Results text area.

If Reality transaction handling is enabled, you can create and populate two small test tables, STAFF and CARS, by selecting the Create Test Tables command from the Database menu. The Recent drop down combo box will be populated with a small number of pre-defined SQL queries for you to try out. The tables may be deleted by selecting the Delete Test Tables command.