SQLJ.INSTALL_JAR stored procedure

SQLJ.INSTALL_JAR creates a new definition of a JAR file in the local DB2® catalog.

SQLJ.INSTALL_JAR authorization

Privilege set: If the CALL statement is embedded in an application program, the privilege set consists of the privileges that are held by the authorization ID of the owner of the plan or package. If the statement is dynamically prepared, the privilege set consists of the privileges that are held by the authorization IDs of the process.

For calling SQLJ.INSTALL_JAR, the privilege set must include at least one of the following items:
  • EXECUTE privilege on SQLJ.INSTALL_JAR
  • Ownership of SQLJ.INSTALL_JAR
  • SYSADM authority
The privilege set must also include the authority to install a JAR, which consists of at least one of the following items:
  • CREATEIN privilege on the schema of the JAR

    The authorization ID that matches the schema name implicitly has the CREATEIN privilege on the schema.

  • SYSADM or SYSCTRL authority

SQLJ.INSTALL_JAR syntax

>>-CALL--SQLJ.INSTALL_JAR--(--url,--JAR-name,--deploy--)-------><

SQLJ.INSTALL_JAR parameters

url
A VARCHAR(1024) input parameter that identifies the z/OS® UNIX System Services full path name for the JAR file that is to be installed in the DB2 catalog. The format is file://path-name or file:/path-name.
JAR-name
A VARCHAR(257) input parameter that contains the DB2 name of the JAR, in the form schema.JAR-id or JAR-id. JAR-name is the name that you use when you refer to the JAR in SQL statements. If you omit schema, DB2 uses the SQL authorization ID that is in the CURRENT SCHEMA special register. The owner of the JAR is the authorization ID in the CURRENT SQLID special register.
deploy
An INTEGER input parameter that indicates whether additional actions are to be performed after the JAR file is installed. Additional actions are not supported, so this value is 0.

SQLJ.INSTALL_JAR example

Suppose that you want to install the JAR file that is in path /u/db2inst3/apps/BUILDPLAN/BUILDPLAN.jar. You want to refer to the JAR file as DB2INST3.BUILDPLAN in SQL statements. Use a CALL statement similar to this one.

CALL SQLJ.INSTALL_JAR('file:/u/db2inst3/apps/BUILDPLAN/BUILDPLAN.jar',
 'DB2INST3.BUILDPLAN',0)