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.
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.
>>-CALL--SQLJ.INSTALL_JAR-- (--'jar-url'--,--'jar-id'--,--deploy--)--> >--------------------------------------------------------------><
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.
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.