Skip Headers

Oracle9i Lite Developer's Guide for Java
Release 5.0.1
Part No. A95261-01
Go To Table Of Contents
Contents
Go To Index
Index

Previous Next

1
Oracle Lite Java Support

This document introduces the Java interfaces and tools supported by Oracle Lite.

Topics include:

1.1 Java Datatypes

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
boolean, Boolean BIT
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)
BigDecimal, BigDecimal[] NUMBER(n)
java.sql.Date, java.sql.Date[] DATE
java.sql.Time, java.sql.Time[] TIME
java.sql.Timestamp, java.sql.Timestamp[] TIMESTAMP
java.sql.Connection Default JDBC connection to database

1.2 Java Tools

Oracle Lite provides tools to manage Java development. Table 1-2 lists these Java tools and their descriptions.

Table 1-2 Java Tools

Tool Description
loadjava Loads Java classes into Oracle Lite.
dropjava Removes Java classes from Oracle Lite.

1.2.1 loadjava

The loadjava utility automates the task of loading Java class and resource files into Oracle Lite. Using loadjava, you can load class and resource files individually, or in ZIP or JAR archives.

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.

For unloading classes, Oracle Lite provides dropjava, which works similarly to loadjava.

1.3 Oracle Lite Java Development Environment

The following tools facilitate Java development for Oracle Lite:

1.3.1 Environment Setup

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.

1.3.1.1 Setting Variables for JDK 1.2

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:

set PATH=c:\jdk1.2\bin;c:\jdk1.2\jre\bin\hotspot;%PATH% 

To test whether your system is set up correctly, run the Java examples in the Oracle_Home\Lite\Examples\Java directory.


Previous Next
Oracle Logo
Copyright © 2002 Oracle Corporation

All rights reserved
Go To Table Of Contents
Contents
Go To Index
Index