|Oracle® Database Java Developer's Guide
10g Release 2 (10.2)
If you install Oracle Database with the Oracle JVM option, then the database is Java-enabled. That is, it is ready to run Java stored procedures, Java Database Connectivity (JDBC), and SQLJ.
This section contains the following topics:
Configure the Oracle JVM option within the database template. This is the recommended method for Java installation.
The Database Configuration Assistant enables you to create database templates for defining what each database instance installation will contain. Choose the Oracle JVM option to have the Java platform installed within your database.
If you have already installed Oracle Database without Oracle JVM, then you can add Java to your database through the modify mode of the Database Configuration Assistant of Oracle Database 10g. The modify mode enables you to choose the features, such as Oracle JVM, that you would like to install on top of an existing Oracle Database instance.
Before you install Oracle JVM as part of your normal Oracle Database installation, you need to ensure that the configuration requirements for Oracle JVM are fulfilled. The main configuration for Java classes within Oracle Database includes configuring the:
Java memory requirements
See Also:"Java Memory Usage"
You must decide whether to use dedicated server processes or shared server processes for your database server.
Installing Oracle JVM creates the
DBMS_JAVA PL/SQL package. Some entry points of
DBMS_JAVA are for external use. That is, these entry points are used by developers. Other entry points are only for internal use. The corresponding Java class,
DbmsJava, provides methods for accessing database functionality from Java.
See Also:Appendix A, "DBMS_JAVA Package"
To run Java between the client and server, your must perform the following:
The client requires Java Development Kit (JDK) 1.4.2 or later. To confirm the version of JDK you are using, run the following commands on the command line:
$ which java /usr/local/j2se1.4.2/bin/java $ which javac /usr/local/j2se1.4.2/bin/javac $ java -version java version "1.4.2"
After installing JDK on your client, add the directory path to the following environment variables:
This variable must be set to the top directory of the installed JDK base.
This variable must include
This variable must include
To ensure that the Java client successfully communicates with the server, include the following files in the
For JDK 1.4.2, include
For JRE 1.4.2, include
For any interaction with JDBC, include
For any client that uses SSL, include
For any client that uses the Java Transaction API (JTA) functionality, include
For any client that uses the Java Naming and Directory Interface (JNDI) functionality, include
If you are using the accelerator for native compilation, include
You must include the
$ORACLE_HOME/sqlj/lib/translator.zip file for SQLJ.
In addition to this file, add the appropriate
.zip file, as follows:
For a Java client using the current release of JDBC, include
For a Java2 Platform, Enterprise Edition (J2EE) client using the current release of JDBC, include
For any JDK client using JDBC 8.1.7 or earlier version, include
If you develop and compile your server applications on the client and want to use the same Java Archive (JAR) files that are loaded on the server, then include
CLASSPATH. This is not required for running Java clients.
When you install Oracle Database with the Oracle JVM option, a set of samples is also installed and available in the
$ORACLE_HOME/javavm/demo directory. These samples can be compiled and run as a test of your installation.
If these samples do not compile or run, then the environment may be incorrectly set. Similarly, if these samples compile and run, but a code written by you does not, then a problem exists within the build environment or code.
Note:When verifying your installation, it is important that you run these examples using the supplied makefiles.
Verify that the samples work before using more complex build environments, such as Visual Cafe, JDeveloper, or VisualAge.