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
-
Java Run Time Environment (JRE) version 1.4.1_02 or above. If this is not available, it can be downloaded from: http://www.oracle.com/technetwork/java/javase/downloads/index.html.
-
If you are connecting to a Reality database on a UNIX host, the host will require UNIX-Connect.
Installation
Windows
-
Start the installation program as described for Windows in the section Starting the installation.
-
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.
-
The default location is c:\Program Files\NorthgateIS\RealSQL-JDBC-1.0; you can override this if required.
-
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
-
Start the installation program as described for UNIX in the section Starting the installation.
-
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]: -
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.
-
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
-
Set up the CLASSPATH environment variable for JReal.
-
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
-
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:
-
The network name of the host system containing the Reality database.
-
The name of the database (defined in a Reality routing entry on the host).
-
The user-id and password of a user on the host system.
-
The name of a account on the Reality database. If this account has a password, enter the password.
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.