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

Registering SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java540433-003
4-11
Naming the Procedure Label
public static void adjustSalary( BigDecimal empNum,
double percent,
BigDecimal[] newSalary )
...
The Java compiler generates this class file from the Java source file:
/usr/mydir/myclasses/pkg/subpkg/Payroll.class
The correct CREATE PROCEDURE clauses that refer to the adjustSalary()
method in the class file are:
EXTERNAL NAME 'pkg.subpkg.Payroll.adjustSalary'
EXTERNAL PATH '/usr/mydir/myclasses'
Example of a JAR File Path
Suppose that the Payroll.java source file is compiled, and the class file is
packaged in a JAR file, myJar.jar, which resides in the /usr/mydir directory:
/usr/mydir/myJar.jar
The correct CREATE PROCEDURE clauses that refer to the adjustSalary()
method in the JAR file are:
EXTERNAL NAME 'pkg.subpkg.Payroll.adjustSalary'
EXTERNAL PATH '/usr/mydir/myJar.jar'
Naming the Procedure Label
The procedure label is used internally by NonStop SQL/MX to track privileges on an
SPJ. Because the procedure label is used internally by NonStop SQL/MX, it is
unnecessary to specify a Guardian name and location for it.
If you do not specify the LOCATION clause, NonStop SQL/MX generates a system-
defined file in the same volume and subvolume as the schema of the SPJ, as shown:
\KINGPIN.$TX0115.ZSDX7KT4.SL9FSB00
If you want to control the location of the procedure label, particularly in a distributed
database environment, specify the LOCATION clause, as shown:
LOCATION \REMOTENODE.$DISKVOL.SUBVOL.PROCLABEL
You can create the procedure label only on a node where the catalog of the SPJ is
visible. For information about registering a catalog on a remote node, see the
SQL/MX
Installation and Management Guide
.
You can also use the LOCATION clause to specify only the volume of the procedure
label:
LOCATION $DISKVOL
In this case, the node is the same node where the SPJ is registered, the subvolume is
the same as the schema of the SPJ, and the file name is system generated.