Oracle9i Lite Developer's Guide for Java
Part No. A95261-01
This document introduces the Java interfaces and tools supported by Oracle Lite.
Oracle Lite performs type conversions between Java and Oracle datatypes as indicated by the following table. Table 1-1 lists the Java datatypes and the corresponding SQL datatypes that result from the type conversion.
Table 1-1 Datatype Conversions
|Java Datatype||SQL Datatype|
|byte, byte, Byte||BINARY, RAW, VARBINARY|
|String, String||CHAR, VARCHAR, VARCHAR2|
|short, short, short, Short, Short||SMALLINT|
|int,int, int, Integer, Integer||INT|
|float, float, float, Float, Float||REAL|
|double, double, double, Double, Double||DOUBLE, NUMBER (without precision)|
|java.sql.Connection||Default JDBC connection to database|
Oracle Lite provides tools to manage Java development. Table 1-2 lists these Java tools and their descriptions.
Table 1-2 Java Tools
||Loads Java classes into Oracle Lite.|
||Removes Java classes from Oracle Lite.|
After you load the class, create a call specification for the methods in the class that you want to make accessible to SQL statements. To create a call specification for a stored procedure that returns a value, use the SQL CREATE FUNCTION statement. If the stored procedure does not return a value, use the CREATE PROCEDURE statement.
Oracle Developer 2.1 supports user-written Java stored procedures in Oracle Lite.
Oracle JDeveloper also supports Java stored procedures in Oracle Lite, and includes features designed specifically to help develop and deploy Java stored procedures.
This section describes how to set up your development environment to create Oracle Lite applications. To develop Java applications, you must have the Sun Microsystems Java Development Kit (JDK), version 1.1.8 (or higher).
After you install Oracle Lite, set your PATH and CLASSPATH environment variables to enable Oracle Lite to work with the JDK. The PATH and CLASSPATH settings vary depending on which version of the JDK you use, as described in the following sections.
If your environment includes a CLASSPATH user variable before you install Oracle Lite, and the user variable does not include the CLASSPATH system variable (is not specified as
CLASSPATH=...;%CLASSPATH%), you must modify the CLASSPATH user variable to include the OLITE40.JAR file in the Oracle_Home\LITE\CLASSES directory.
Note:All command prompt windows must be closed and reopened to reflect changes made to your CLASSPATH.
If you are using JDK 1.2, the directory with the JDK 1.2 Java compiler (javac.exe) should be in the PATH variable before any other directories that contain other Java compilers.
Add the directory that contains the Classic Java Virtual Machine (JVM) shared library, jvm.dll, to the PATH. jvm.dll should be in your JDK_Home\jre\bin\classic directory.
Remove oljdk11.jar from the CLASSPATH. This ensures that the version of system classes used by Oracle Lite matches that used by the JDK. For example:
set PATH=c:\JDK_Home\bin;c:\JDK_Home\jre\bin\classic set CLASSPATH=c:\JDK_Home\jrc\lib\rt.jar;c:\Oracle_Home\lite\classes\olite40.jar
As an alternative to using the Classic JVM, you can use the HotSpot JVM. HotSpot is a JDK add-on module provided by Sun Microsystems. HotSpot is available from the Sun Microsystems Web site.
After installing HotSpot, set your PATH as follows:
To test whether your system is set up correctly, run the Java examples in the Oracle_Home\Lite\Examples\Java directory.