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-10
Naming the Procedure Label
Example of a Class File Path
For example, consider the /usr/mydir/myclasses/Payroll.java source file:
package pkg.subpkg;
public class Payroll
{
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.