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

The java-installation-directory is the path of the installation directory of the NonStop
Server for Java.
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 (page 25).
Scope of JREHOME in UDR_JAVA_OPTIONS
A JREHOME location set by a CONTROL QUERY DEFAULT statement affects the SPJ environment
of subsequent CALL or CREATE PROCEDURE statements. This JREHOME location setting persists
until the SQL/MX UDR server process, which hosts the SPJ environment, ends. For more information,
see SQL/MX UDR Server Process (page 25). For example, use a CONTROL QUERY DEFAULT
statement to set the JREHOME location before a CALL statement in an application:
CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS
'-Dsqlmx.udr.jrehome=/usr/myjavadir/jre';
CALL...
A JREHOME setting inserted into the SYSTEM_DEFAULTS table affects all CALL or CREATE
PROCEDURE statements that run on the system. This JREHOME 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 JREHOME location 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',
'-Dsqlmx.udr.jrehome=/usr/myjavadir/jre');
For more information about the scope of the UDR_JAVA_OPTIONS setting, see Controlling JVM
Startup Options (page 36).
Precedence of JREHOME 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
JREHOME environment variable. See Setting the JREHOME Environment Variable (page 41).
Setting the JREHOME Environment Variable
Use the JREHOME environment variable to set the JREHOME location in an SPJ environment for a
session in which applications that call or create SPJs run. Set the JREHOME 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 JREHOME by Using UDR_JAVA_OPTIONS (page 40).
Scope of the JREHOME Environment Variable
The setting of the JREHOME environment variable persists for the current OSS or Guardian session
and applies to all applications running in the current session.
Precedence of the JREHOME Environment Variable
The UDR_JAVA_OPTIONS setting takes precedence over the JREHOME environment variable. See
Setting JREHOME by Using UDR_JAVA_OPTIONS (page 40).
Setting the JREHOME Location 41