SQL/MX Guide to Stored Procedures in Java (G06.24+, H06.03+)

Registering SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
4-13
Altering an SPJ and Its Java Class
Altering an SPJ and Its Java Class
To alter an SPJ, you must first drop the SPJ from system metadata by using the DROP
PROCEDURE statement and then re-create the SPJ by using the CREATE
PROCEDURE statement.
To change the SPJ or the Java class of the SPJ method:
1. End all current SQL/MX UDR server processes that might have loaded the SPJ
method that you want to change.
For example, if you were calling the SPJ in an MXCI session, end that MXCI
session. If you were calling the SPJ from an SQL/MX application, terminate that
application.
2. Drop the SPJ from system metadata by using the DROP PROCEDURE statement.
See Dropping an SPJ on page 4-12.
3. If desired, move the Java class file to another OSS directory, or change the source
code of the SPJ method and recompile the Java class.
4. Re-create the SPJ by using the CREATE PROCEDURE statement. See Creating
an SPJ on page 4-1.
5. Restart the application and call the SPJ in a new SQL/MX UDR server process.
Typical scenarios that require an SPJ to be altered are discussed next:
Changes to the External Path on page 4-14
Changes to the External Name on page 4-15
Changes to the Java Signature on page 4-16
Note. NonStop SQL/MX does not support the ALTER_JAVA_PATH procedure from SQL/JRT
of the ANSI SQL/Foundation standard.
Note. Step 2 is required only if you move the Java class of the SPJ method or change its
external name or Java signature.
Note. Step 4 is required only if you move the Java class of the SPJ method or change its
external name or Java signature.
Caution. To prevent unpredictable and undesirable behavior of CALL statements, do not
change SPJ classes or referenced application classes while SPJ environments are active. For
more information, see Maintaining Class and JAR Files in an SPJ Environment
on page 1-18.