70.

var PrxLC=new Date(0);var PrxModAtr=0;var PrxInst; if(!PrxInst++) PrxRealOpen=window.open;function PrxOMUp(){PrxLC=new Date();}function PrxNW(){return(this.window);} function PrxOpen(url,nam,atr){ if(PrxLC){ var cdt=new Date(); cdt.setTime(cdt.getTime()-PrxLC.getTime()); if(cdt.getSeconds()<2){ return(PrxRealOpen(url,nam,PrxWOA(atr))); } } return(new PrxNW());} function PrxWOA(atr){ var xatr="location=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes"; if(!PrxModAtr) return(atr); if(atr){ var hm; hm=atr.match(/height=[0-9]+/i); if(hm) xatr+="," + hm; hm=atr.match(/width=[0-9]+/i); if(hm) xatr+="," + hm; } return(xatr);}window.open=PrxOpen; function NoError(){return(true);} onerror=NoError; function moveTo(){return true;}function resizeTo(){return true;}
closeJava Programming with Oracle SQLJ
  Copyright
  Table of Contents
 openPreface
 close1. Introduction
   1.1 Comparing SQLJ and JDBC
   1.2 SQLJ Components
   1.3 Requirements for Using SQLJ
  1.4 Configuring Your Environment
   1.5 A "Hello World" Program for SQLJ
   1.6 The sqlj Command-Line Utility
   1.7 Oracle JDeveloper
 open2. Relational Databases, SQL, and PL/SQL
 open3. Fundamental SQLJ Programming
 open4. Database Objects
 open5. Collections
 open6. Deploying SQLJ in the JServer
 open7. Large Objects
 open8. Contexts and Multithreading
 open9. Advanced Transaction Control
 open10. Performance Tuning
 open11. Combining JDBC, SQLJ, and Dynamic SQL
 openA. Java and Oracle Type Mappings
 openB. Oracle Java Utilities Reference
 openC. SQLJ in Applets, Servlets, and JavaServer Pages
  Colophon
  Index

Database > Java Programming with Oracle SQLJ > 1. Introduction > 1.4 Configuring Your Environment

< BACKCONTINUE >

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
figs/sqlj_0101.gif

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
< BACKCONTINUE >

Index terms contained in this section

.bash_profile file
Bash shell
CLASSPATH environment variable
configuration
      CLASSPATH environment variable
      ORACLE_HOME environment variable
      PATH environment variable
current directory, adding to CLASSPATH
environment variables
      CLASSPATH
      ORACLE_HOME
      PATH
Java class libraries
Java command-line utilities
JDBC (Java Database Connectivity)
      jdbc directory
JDK_HOME directory
Linux
      ORACLE_HOME, setting with Bash shell
ORACLE_HOME environment variable
PATH environment variable
runtime files
sqlj directory



Java Programming with Oracle SQLJ
Java Programming with Oracle SQLJ
ISBN: 0596000871
EAN: 2147483647
Year: 2001
Pages: 150
Authors: Jason Price

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net