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-7
Specifying the SPJ Method
If the SPJ method passes character string values to or from an SQL/MP table that has
a KANJI (Japanese) or KSC5601 (Korean) column, use the ISO88591 character set for
the SQL parameter.
For more information, see character sets in the SQL/MX Reference Manual.
Specifying the SPJ Method
Specify the external Java method to be used as the SPJ method in the EXTERNAL
NAME clause, as shown:
The Java method that you specify in the EXTERNAL NAME clause must be defined as
public and static and have a return type of void. For more information, see
Guidelines for Writing SPJ Methods on page 3-1.
NonStop SQL/MX does not allow JAR file names to be specified in the EXTERNAL
NAME clause. Instead, use the EXTERNAL PATH clause to specify the location of a
JAR file that contains the Java class. See Specifying the External Path on page 4-9.
Java Method Name
The Java method name consists of the case-sensitive names of the method and the
Java class that contains the method. For example, the Java method named
adjustSalary() is prefixed with the name of its class, Payroll:
'Payroll.adjustSalary'
If the class is stored in a package, you must also specify the package name. In this
example, the package and subpackage names of the class file are pkg.subpkg:
'pkg.subpkg.Payroll.adjustSalary'
If you do not specify the class name and package, if it exists, in the EXTERNAL NAME
clause, the CREATE PROCEDURE statement fails to register the SPJ.
Caution. NonStop SQL/MX does not maintain the Java class file that contains the SPJ
method. NonStop SQL/MX records only a reference to the location of the Java class file in
system metadata. Subsequent changes to the Java class file after you register the SPJ might
result in run-time errors when you try to execute the SPJ. For guidelines on how to alter an
SPJ, see Altering an SPJ and Its Java Class
on page 4-13.
VST019.vsd
EXTERNAL NAME 'Payroll.adjustSalary'
Class Name
Method Name