SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)

SYSTEM_DEFAULTS table to set the class path for all CREATE PROCEDURE statements that are
registered on the system:
SET SCHEMA NONSTOP_SQLMX_node.SYSTEM_DEFAULTS_SCHEMA;
INSERT INTO SYSTEM_DEFAULTS
(ATTRIBUTE, ATTR_VALUE)
VALUES ('UDR_JAVA_OPTIONS',
'-Djava.class.path=/usr/otherclasses:/usr/otherapps/myJar.jar');
For more information about the scope of the UDR_JAVA_OPTIONS setting, see Controlling JVM
Startup Options (page 36).
Precedence of the Class Path in UDR_JAVA_OPTIONS
The CONTROL QUERY DEFAULT setting overrides the UDR_JAVA_OPTIONS setting in the
SYSTEM_DEFAULTS table. Both types of UDR_JAVA_OPTIONS settings take precedence over the
CLASSPATH environment variable. See Setting the CLASSPATH Environment Variable (page 45).
Setting the CLASSPATH Environment Variable
Use the CLASSPATH environment variable to set the class path in an SPJ environment for a session
in which applications that call or create SPJs run. Set the CLASSPATH environment variable in
either the OSS or Guardian environment, depending on where you run applications that issue
CALL or CREATE PROCEDURE statements.
NOTE: NonStop ODBC/MX applications cannot use environment variables set in the OSS or
Guardian environment. See Setting the Class Path by Using UDR_JAVA_OPTIONS (page 44).
Scope of the CLASSPATH Environment Variable
The setting of the CLASSPATH environment variable persists for the current OSS or Guardian
session and applies to all applications running in the current session.
Precedence of the CLASSPATH Environment Variable
The UDR_JAVA_OPTIONS setting takes precedence over the CLASSPATH environment variable.
See Setting the Class Path by Using UDR_JAVA_OPTIONS (page 44).
Setting CLASSPATH in the OSS Environment
To set the CLASSPATH environment variable in the OSS environment, enter this command at an
OSS prompt:
export CLASSPATH=["][$CLASSPATH:]path1[{:path2}...]["]
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 in the current OSS session:
export CLASSPATH="$CLASSPATH:/usr/otherapps/myJar.jar:
/usr/otherclasses"
For more information about the export command, see the Open System Services Shell and Utilities
Reference Manual.
Setting CLASSPATH in the Guardian Environment
To set the CLASSPATH environment variable in the Guardian environment, enter this PARAM
command at a Guardian prompt:
PARAM CLASSPATH path1[{: path2}...]
Setting the Class Path 45