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

Getting Started
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
2-25
Installing JAR Files in NonStop SQL/MX
path1 and path2 are paths to JAR files or top-level directories where Java classes or
package directories exist. The paths must not include the package name.
For example, this command sets the class path for SPJs invoked from embedded SQL
programs in C, C++, or COBOL that will run in the current Guardian session:
PARAM CLASSPATH /usr/otherapps/myJar.jar:/usr/otherclasses
For more information about the PARAM command, see the TACL Reference Manual.
Installing JAR Files in NonStop SQL/MX
NonStop SQL/MX supports SPJ methods that are packaged in JAR files but does not
support the INSTALL_JAR, REMOVE_JAR, REPLACE_JAR, and ALTER_JAR_PATH
procedures from SQL/JRT of the ANSI SQL/Foundation standard.
To use a Java method in a JAR file as the body of an SPJ:
1. Place the JAR file in an OSS directory where you want to register the SPJ.
For example, this OSS command copies the myJar.jar file from a private
location of /usr/myfiles to the public location of /usr/spjfiles:
cp /E/DEV/usr/mydir/myJar.jar \
/E/PROD/usr/spjfiles/myJar.jar
2. Issue a CREATE PROCEDURE statement to register the SPJ, using the full OSS
path of the JAR file in the EXTERNAL PATH clause:
CREATE PROCEDURE samdbcat.sales.lowerprice()
EXTERNAL NAME 'pkg.subpkg.Sales.lowerPrice'
EXTERNAL PATH '/usr/spjfiles/myJar.jar'
...
For more information, see Creating an SPJ on page 4-1.