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-16
Changes to the Java Signature
Changes to the Java Signature
The Java signature specifies each of the parameter data types in the Java method
definition. A change to the Java signature of an SPJ suggests a fundamental change to
the underlying Java class of the existing SPJ method.
For example, suppose that you reassign the SPJ named MONTHLYORDERS from the
SPJ method named numMonthlyOrders() to another SPJ method named
numMonthlyOrders2(), which has a different Java signature.
The SPJ named MONTHLYORDERS was originally registered in system metadata as:
CREATE PROCEDURE samdbcat.sales.monthlyorders(IN INT,
OUT number INT)
EXTERNAL NAME 'pkg.subpkg.Sales.numMonthlyOrders'
EXTERNAL PATH '/usr/myapps/myJar.jar'
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA;
To drop the SPJ, issue this DROP PROCEDURE statement:
DROP PROCEDURE samdbcat.sales.monthlyorders;
To re-create the SPJ, issue this CREATE PROCEDURE statement:
CREATE PROCEDURE samdbcat.sales.monthlyorders(IN INT,
IN partnum NUMERIC(4),
OUT number INT)
EXTERNAL NAME 'pkg.subpkg.Sales.numMonthlyOrders2'
EXTERNAL PATH '/usr/myapps/myJar.jar'
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA;
You must update the CALL statements in the source code of the calling applications so
that the arguments match the new parameters of the SPJ. If the application is statically
compiled, you must recompile the entire application. You can now successfully execute
the new SPJ method by issuing the updated CALL statements.