Defining Java Routines And Jar Files To Db2; Definition Of A Java Routine To Db2 - IBM DB2 Manual

Table of Contents

Advertisement

Defining Java routines and JAR files to DB2

|
|
|
|
|
|
|
|
|
|
|
|

Definition of a Java routine to DB2

164
Application Programming Guide and Reference for Java
"Preparing Java routines with no SQLJ clauses and no JAR file" on page 188
"Preparing Java routines with SQLJ clauses and no JAR file" on page 190
"Installing the z/OS Application Connectivity to DB2 for z/OS feature" on
page 435
"Upgrading the IBM Data Server Driver for JDBC and SQLJ to a new version"
on page 434
Before you can use a Java routine, you need to define it to DB2.
If the routine is in a JAR file, it is recommended that you also define the JAR file
to DB2. Alternatively, you can include the JAR file name in the CLASSPATH.
If you use IBM Data Studio, IBM Data Studio creates the definitions. If you do not
use IBM Data Studio, perform these steps:
1. Execute the CREATE PROCEDURE or CREATE FUNCTION statement to
define the routine to DB2. To alter the routine definition, use the ALTER
PROCEDURE or ALTER FUNCTION statement.
2. If the routines are in JAR files, define the JAR files to DB2.
v Use the SQLJ.INSTALL_JAR or SQLJ.DB2_INSTALL_JAR built-in stored
procedure to define the JAR files to DB2.
v After you have installed a JAR, if that JAR references classes in other
installed JARs, use the SQLJ.ALTER_JAVA_PATH stored procedure to specify
the class resolution path that the JVM searches to resolve those class
references.
v To replace the JAR file, use the SQLJ.REPLACE_JAR or
SQLJ.DB2_REPLACE_JAR stored procedure.
v To remove the JAR file, use the SQLJ.REMOVE_JAR or
SQLJ.DB2_REMOVE_JAR stored procedure.
SQLJ.INSTALL_JAR, SQLJ, SQLJ.REPLACE_JAR, and SQLJ.REMOVE_JAR can
be used only with the local DB2 catalog. The other stored procedures can be
used with remote or local DB2 catalogs.
Before you can use a Java routine, you need to define it to DB2 using the CREATE
PROCEDURE or CREATE FUNCTION statement.
The definition for a Java routine is much like the definition for a routine in any
other language. However, the following parameters have different meanings for
Java routines.
LANGUAGE
Specifies the application programming language in which the routine is
written.
Specify LANGUAGE JAVA.
You cannot specify LANGUAGE JAVA for a user-defined table function.
EXTERNAL NAME
Specifies the program that runs when the procedure name is specified in a
CALL statement or the user-defined function name is specified in an SQL

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents