Java Routine Programming - IBM DB2 Manual

Table of Contents

Advertisement

path
*
Java-package-name.*
Java-package-name.class-name or class-name
JAR-name2

Java routine programming

A Java routine is a Java application program that runs in a stored procedure
address space. It can include JDBC methods or SQLJ clauses.
A Java routine is much like any other Java program and follows the same rules as
routines in other languages. It receives input parameters, executes Java statements,
optionally executes SQLJ clauses, JDBC methods, or a combination of both, and
returns output parameters.
A VARCHAR(2048) input parameter that specifies the class resolution path that
the JVM uses when Jar-name references a class that is not contained in
JAR-name, found in the CLASSPATH, or system-supplied.
During execution of the Java routine, when DB2 encounters an unresolved
class reference, DB2 compares each path element in the path to the class
reference. If a path element matches the class reference, DB2 searches for the
class in the JAR that is specified by the path element.
Indicates that any class reference can be searched for in the JAR that is
identified by JAR-name2. If an error prevents the class from being found, the
search terminates and a java.lang.ClassNotFoundException is thrown to report
that error. If the class is not found in the JAR, the search continues with the
next path element.
Indicates that class references for classes that are in the package named
Java-package-name are searched for in the JAR identified by JAR-name2. If an
error prevents a class from being found, the search terminates and a
java.lang.ClassNotFoundException is thrown to report that error. If a class is
not found in the JAR, the search terminates and a
java.lang.NoClassDefFoundError is thrown.
If the class reference is to a class in a different package, the search continues
with the next path element.
Indicates that class references for classes whose fully qualified name matches
Java-package-name.class-name or class-name are searched for in the JAR identified
by JAR-name2. Class references for classes that are in packages within the
package named Java-package-name are not searched for in the JAR identified by
JAR-name2. If an error prevents a class from being found, the search terminates
and a java.lang.ClassNotFoundException is thrown to report that error. If a
class is not found in the JAR, the search terminates and a
java.lang.NoClassDefFoundError is thrown.
If the class reference is to a different class, the search continues with the next
path element.
Specifies the DB2 name of the JAR that is to be searched. The form of
JAR-name2 is schema.JAR-id or JAR-id. If schema is omitted, the JAR name is
implicitly qualified with the schema name in the CURRENT SCHEMA special
register. JAR JAR-name2 must exist at the current server. JAR-name2 must not
be the same as JAR-name1.
Chapter 5. Java stored procedures and user-defined functions
175

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents