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-18
Setting the JREHOME Environment Variable
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
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 on page 2-11.
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 on page 2-18.
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.
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.
Note. NonStop ODBC/MX applications cannot use environment variables set in the OSS or
Guardian environment. See Setting JREHOME by Using UDR_JAVA_OPTIONS on page 2-17.