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-23
Setting the Class Path by Using
UDR_JAVA_OPTIONS
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.
Scope of the Class Path in UDR_JAVA_OPTIONS
A class path set by a CONTROL QUERY DEFAULT statement affects the SPJ
environment of subsequent CALL or CREATE PROCEDURE statements. This class
path setting persists until the SQL/MX UDR server process, which hosts the SPJ
environment, ends. For more information, see SQL/MX UDR Server Process on
page 1-12. For example, use a CONTROL QUERY DEFAULT statement to set the
class path before a CALL statement in an application:
CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS
'-Djava.class.path=/usr/otherclasses:/usr/otherapps/myJar.jar';
CALL...
A class path inserted into the SYSTEM_DEFAULTS table affects all CALL or CREATE
PROCEDURE statements that run on the system. This class path setting persists until
someone updates the UDR_JAVA_OPTIONS attribute in the SYSTEM_DEFAULTS
table. For example, insert a row in the 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 on page 2-11.
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 on page 2-24.
Caution. NonStop SQL/MX maintains an SQL/MX UDR server process for each different set
of UDR_JAVA_OPTIONS in an application. The existence of multiple SQL/MX UDR server
processes might significantly affect system performance. Therefore, use
UDR_JAVA_OPTIONS settings in your application only when necessary. For more information,
see SQL/MX UDR Server Process
on page 1-12.