1.4 Configuring Your Environment This section describes how to configure your computing environment to develop and run SQLJ programs. Three environment variables must be set: ORACLE_HOME, PATH, and CLASSPATH. The ORACLE_HOME environment variable specifies the directory in which the Oracle software is installed. The PATH environment variable specifies a list of directories that contain the command-line utilities. The CLASSPATH environment variable specifies a list of Java class libraries and directories used by the various Java utilities. 1.4.1 The ORACLE_HOME Environment Variable The ORACLE_HOME environment variable should be set to the directory where the Oracle software is installed. Many Oracle applications and utilities depend on the ORACLE_HOME environment variable to point the way to the Oracle software directory. To set your ORACLE_HOME environment variable using Windows NT 4.0, use the System Properties dialog in the Control Panel. Figure 1-1 shows the ORACLE_HOME environment variable in the System Properties dialog. Figure 1-1. Setting the ORACLE_HOME environment variable in Windows NT 4.0 To set your ORACLE_HOME environment variable using the Bash shell with Linux, add lines similar to the following to your .bash_profile file: ORACLE_HOME= installation_directory export ORACLE_HOME where installation_directory is the directory in which the Oracle software is installed. 1.4.2 The PATH Environment Variable The following two directories should be added to your PATH environment variable: - JDK_HOME\bin
-
JDK_HOME is the directory where the Sun JDK is installed. This directory contains the Java command-line utilities. - ORACLE_HOME\bin
-
ORACLE_HOME is the directory where the Oracle software is installed. This directory contains the Oracle command-line utilities. To set your PATH environment variable using Windows NT 4.0, use the System Properties dialog in the Control Panel. To set your PATH environment variable using the Bash shell with Linux, add lines similar to the following to your .bash_profile file: PATH=$PATH:/usr/local/jdk1.2.2/bin:$ORACLE_HOME/bin export PATH 1.4.3 The CLASSPATH Environment Variable When the Oracle software is installed, a directory named jdbc is created under the ORACLE_HOME directory. This directory contains example programs, documentation, and the libraries for Oracle JDBC. The JDBC libraries are contained in a ZIP file, and this ZIP file must be included in your CLASSPATH environment variable. If you are using JDK 1.2.x or higher, the file ORACLE_HOME\jdbc\lib\classes12.zip should be added to your CLASSPATH. If you are using JDK 1.1.x, then ORACLE_HOME\jdbc\lib\classes111.zip should be added to CLASSPATH. In addition to the jdbc directory, a directory named sqlj is created under the ORACLE_HOME directory. This directory contains example programs, documentation, and the libraries for Oracle SQLJ. To support SQLJ, add the file ORACLE_HOME\sqlj\lib\translator.zip to your CLASSPATH environment variable. You should also add one of the following SQLJ runtime files to your CLASSPATH environment variable, depending on which version of the JDK you are using: - ORACLE_HOME\sqlj\lib\runtime11.zip
-
If you are using JDK 1.1.x - ORACLE_HOME\sqlj\lib\runtime12.zip
-
If you are using JDK 1.2.x - ORACLE_HOME\sqlj\lib\runtime12ee.zip
-
If you are using JDK 1.2.x Enterprise Edition Alternatively, you can add ORACLE_HOME\sqlj\lib\runtime.zip, which is compatible with all JDK versions. However, that runtime library doesn't comply with the ISO standard when it comes to using JDBC 2.0 types. | You should also add the current directory, specified using the dot (.) character, to your CLASSPATH. |
| If you are using Windows NT 4.0, you should set your CLASSPATH using the System Properties dialog. If you are using the Bash shell with Linux, you should add lines similar to the following to your .bash_profile file: CLASSPATH=$CLASSPATH:.:$ORACLE_HOME/sqlj/lib/translator.zip: $ORACLE_HOME/sqlj/lib/runtime.zip:$ORACLE_HOME/jdbc/lib/classes12.zip export CLASSPATH |