SQLJ.INSTALL_JAR

The SQLJ.INSTALL_JAR stored procedure installs a JAR file into the database system. This JAR file can be used in subsequent CREATE FUNCTION and CREATE PROCEDURE statements.

Authorization

The privilege held by the authorization ID of the CALL statement must include at least one of the following for the SYSJAROBJECTS and SYSJARCONTENTS catalog tables:

The privilege held by the authorization ID of the CALL statement must also have the following authorities:

Adopted authority cannot be used for these authorities.

SQL syntax

     >>-CALL--SQLJ.INSTALL_JAR-- (--'jar-url'--,--'jar-id'--,--deploy--)-->
 
     >--------------------------------------------------------------><

Description

jar-url
The URL containing the JAR file to be installed or replaced. The only URL scheme supported is 'file:'.
jar-id
The JAR identifier in the database to be associated with the file specified by the jar-url. The jar-id uses SQL naming and the JAR file is installed in the schema or library specified by the implicit or explicit qualifier.
deploy
Value used to describe the install_action of the deployment descriptor file. If this integer is a nonzero value, then the install_actions of a deployment descriptor file should be run at the end of the install_jar procedure. The current version of DB2® UDB for iSeries™ only supports a value of zero.

Usage notes

When a JAR file is installed, DB2 UDB for iSeries registers the JAR file in the SYSJAROBJECTS system catalog. It also extracts the names of the Java(TM) class files from the JAR file and registers each class in the SYSJARCONTENTS system catalog. DB2 UDB for iSeries copies the JAR file to a jar/schema subdirectory of the /QIBM/UserData/OS400/SQLLib/Function directory. DB2 UDB for iSeries gives the new copy of the JAR file the name given in the jar-id clause. A JAR file that has been installed by DB2 UDB for iSeries into a subdirectory of /QIBM/UserData/OS400/SQLLib/Function/jar should not be changed. Instead, the CALL SQLJ.REMOVE_JAR and CALL SQLJ.REPLACE_JAR SQL commands should be used to remove or replace an installed JAR file.

Example

The following command is issued from an SQL interactive session.

     CALL SQLJ.INSTALL_JAR('file:/home/db2inst/classes/Proc.jar' , 'myproc_jar', 0)

The Proc.jar file located in the file:/home/db2inst/classes/ directory is installed into DB2 UDB for iSeries with the name myproc_jar. Subsequent SQL commands that use the Procedure.jar file refer to it with the name myproc_jar.

Related reference
SQLJ.REMOVE_JAR
SQLJ.REPLACE_JAR
SQLJ.UPDATEJARINFO
SQLJ.RECOVERJAR
SQLJ.REFRESH_CLASSES