SQLJ.REMOVE_JAR stored procedure

SQLJ.REMOVE_JAR deletes a JAR file from the local Db2® catalog or from a remote Db2 catalog.

To delete a JAR file at a remote location, you need to execute a CONNECT statement to connect to that location before you call SQLJ.REMOVE_JAR.

The JAR cannot be referenced in the EXTERNAL NAME clause of an existing routine, or in the path of an installed JAR.

SQLJ.REMOVE_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.REMOVE_JAR, the privilege set must include at least one of the following items:
  • EXECUTE privilege on SQLJ.REMOVE_JAR
  • Ownership of SQLJ.REMOVE_JAR
  • SYSADM authority
The privilege set must also include the authority to remove a JAR, which consists of at least one of the following items:
  • Ownership of the JAR
  • DROPIN privilege on the schema of the JAR

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

  • SYSADM or SYSCTRL authority


Read syntax diagramSkip visual syntax diagram CALL SQLJ.REMOVE_JAR ( JAR-name, undeploy )

SQLJ.REMOVE_JAR parameters

A VARCHAR(257) input parameter that contains the Db2 name of the JAR that is to be removed from the catalog, 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.
An INTEGER input parameter that indicates whether additional actions should be performed before the JAR file is removed. Additional actions are not supported, so this value is 0.


Suppose that you want to remove a previously installed JAR file that is named DB2INST3.BUILDPLAN. Use a CALL statement similar to this one.