remove java

Removes one or more Java-SQL classes, packages, or JARs from a database, when Java classes are installed in the database.

Syntax

remove java 
	class class_name[, class_name]...
		| package package_name[, package_name]...
		| jar jar_name[, jar_name]...[retain classes]

Parameters

Usage

  • If a remove java statement is contained in a stored procedure, the current database is the database that is current when the procedure is created, not the database that is current when the procedure is called.

    If a remove java statement is not contained in a stored procedure, the current database is the database that is current when the remove statement is executed.

  • If class or package is specified and any removed class has an associated JAR, then an exception is raised.

  • If any stored procedure, table, or view contains a reference to a removed class as the datatype of a column, variable, or parameter, then an exception is raised.

  • All removed classes are:
    • Deleted from the current database.

    • Unloaded from the Java Virtual Machine (Java VM) of the current connection. The removed classes are not unloaded from the Java VMs of other connections.

  • If any exception is raised during the execution of remove java, then all actions of remove java are cancelled.

  • You cannot remove a Java-SQL class if that class is directly referenced by a SQLJ stored procedure or function.

  • To remove a Java-SQL class from the database, you must:
    1. Delete all SQLJ stored procedures or functions that directly reference the class using drop procedure and drop function.

    2. Delete the Java-SQL class from the database using remove java.

  • When you use remove java, an exclusive table lock is placed on sysxtypes.

  • If jar is specified, then an exclusive table lock is placed on sysjars.

See also:
  • Java in Adaptive Server Enterprise

  • sp_helpjava in Reference Manual: Procedures

  • sysjars, sysxtypes in Reference Manual: Tables

  • extractjava, installjava in the Utility Guide

Permissions

You must be a system administrator or database owner to use remove java.

The permission checks for remove jar class differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage database privilege.

Disabled

With granular permissions disabled, you must be the database owner.

Auditing

Values in event and extrainfo columns of sysaudits are:

InformationValues
Event

94

Audit option

remove

Command or access audited

remove java

Information in extrainfo
  • Roles – current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – original login name, if a set proxy is in effect