|Oracle® Database Java Developer's Guide
10g Release 1 (10.1)
Part Number B12021-02
This chapter describes what you need to know to install and configure OracleJVM within your database. To configure Java memory, see the "Java Memory Usage" section in Chapter 10, "Oracle Database Java Application Performance".
Configure the OracleJVM option within the database template. This is the recommended method for Java installation.
The Database Configuration Assistant allows you to create database templates for defining what each database instance installation will contain. Choose the OracleJVM option to have the Java platform installed within your database. See the Database Configuration Assistant documentation for more information on template creation.
If you have already installed your Oracle Database without OracleJVM, you can add Java to your database through the modify mode of the Oracle Database 10g Configuration Assistant. The modify mode enables you to choose the features, such as OracleJVM, that you would like installed on top of an existing Oracle Database.
When you install OracleJVM as part of your normal Oracle Database installation, you will encounter configuration requirements for OracleJVM within the Oracle Database 10g Configuration Assistant and the Oracle Net Assistant.
Java memory requirements—You must have at least 20 MB of
JAVA_POOL_SIZE and 50 MB of
SHARED_POOL_SIZE. See "Java Memory Usage" for information on configuring these parameters.
Installing OracleJVM creates the PL/SQL package
DBMS_JAVA. Some entry points of
DBMS_JAVA are for your use; others are only for internal use. The corresponding Java class
DbmsJava provides methods for accessing RDBMS functionality from Java.
See "DBMS_JAVA Package" for complete information.
The client requires JDK 1.2.1 or later. To confirm what version of the JDK you are using, perform the following:
$ which java /usr/local/j2se1.4.1/bin/java $ which javac /usr/local/j2se1.4.1/bin/javac $ java -version java version "1.4.1"
After installing the JDK on your client, you must add the directory path to the following environment variables:
Note:For NT users, the syntax for the environment variables is %ORACLE_HOME%, %JAVA_HOME%, %PATH%, and %LIB%.
$JAVA_HOME—must be set to the top directory of the installed JDK base
$LD_LIBRARY_PATH for Solaris or
%LIB% for Windows NT—must include
For a Java 2 client to communicate with the Java 2 server, you must make sure that one of the following JVM JAR files are in the CLASSPATH:
For JDK 1.2, include
For JRE 1.2, include
For any interaction with JDBC, include the following ZIP file:
For any client that uses SSL, include the following JAR files:
For any client that uses Java Transaction API (JTA) functionality, include the following JAR file:
For any client that uses JNDI functionality, include the following JAR file:
If you are using the Accelerator for native compilation, include
We provide a set of samples in the
$ORACLE_HOME/javavm/demo directory. These samples compile and run for a database installed with the OracleJVM option. Execute these samples as a test of your installation.
If these samples do not compile or run, your environment is incorrect. Similarly, if these samples compile and run, but your code does not, then a problem exists within your build environment or code.
Note:It is important that you run these examples using the supplied Makefiles (or batch files on NT) when verifying your installation.