DB2 Version 10.1 for Linux, UNIX, and Windows

Updating Java routine classes

If you want to change the logic of a Java™ routine, you must update the routine source code, compile (translate) the code, and then update the version of the Java class or JAR file that is deployed to the DB2® database server.

About this task

To ensure that DB2 database manager uses the new version of the Java routine, you must execute a built-in procedure that will load the new version of the Java class into memory.

Procedure

To update Java routine classes:

  1. Deploy the new Java class or JAR file to the DB2 database server.
  2. Execute the following built-in procedure for fenced routines:
      CALL SQLJ.REFRESH_CLASSES()
    This will force the DB2 database manager to load the new class into memory upon the next commit or rollback operation.

    For unfenced routines, this step will not work. For unfenced routines, you must explicitly stop and restart the DB2 database manager in order for new versions of Java routine classes to be loaded and used.

Results

If you do not perform the steps listed previously, after you update Java routine classes, the DB2 database manager will continue to use the previous versions of the classes.