SQLJ requires an installation of JDK1.1 from JavaSoft. It must be installed and the Java interpreter must be available in your path. In the rest of this page we assumed that both the Java compiler (javac) and the Java interpreter (java) are installed correctly in your path.
Since SQLJ runs on top of the JDBC API, a driver compliant
with the database to be used must be installed in your system. The current
version of SQLJ has been tested with the production release of Oracle's
JDBC driver and the JDBC-ODBC
Bridge available for free download from JavaSoft. Go to these sites
to find out how to install these products.
To install proceed as follows:
Windows users may want use tools like winzip
(Version 6.0 and up). On UNIX environments one can use the command:
gzip -dc sqlj_1011.tgz | tar xvf -
This completes the installation.
To test if your installation is correct, follow the instructions in the "Getting Started" section of the SQLJ User's Guide and Reference.
As mentioned before, you must have installed a JDBC driver in your environment. The connection URL depends on the particular vendor that provided your JDBC driver. Consult the vendor documentation for the fully qualified name for the JDBC driver class, and for the syntax of the url used to connect to a database using that driver.
The following table indicates the value of these parameters for different
vendors.
JDBC Driver | JDBC Driver Class Name | JDBC URL |
---|---|---|
Generic Vendor | vendor.jdbc.Driver | jdbc:vendor:oracle_sid |
Oracle JDBC-OCI7 | oracle.jdbc.driver.OracleDriver | jdbc:oracle:oci7:@oracle_sid |
Oracle JDBC-OCI8 | oracle.jdbc.driver.OracleDriver | jdbc:oracle:oci8:@oracle_sid |
Oracle JDBC-Thin | oracle.jdbc.driver.OracleDriver | jdbc:oracle:thin:@host:1521:oracle_sid |
Weblogic | weblogic.jdbc.oci.Driver | jdbc:weblogic:oracle:oracle_sid |
In the table, oracle_sid, corresponds to the TNS_alias defined in your local tnsnames.ora file. Most drivers allow other ways to specify a remote database in the URL that do not require the existence of aliases in your environment. Consult the documentation of your JDBC driver for the specific syntax.
Since SQLJ relies on JDBC for acquiring the connections to be
used, in your application you can use any of the JDBC mechanisms recommended
by your vendor for loading the JDBC driver and specifying the database
URL.