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-17
Setting the JREHOME Location
Setting the JREHOME Location
By default, NonStop SQL/MX loads Java components from the standard location of the
NonStop Server for Java into the SPJ environment. If you install the NonStop Server
for Java in a nonstandard location, you must set the JREHOME location to the current
installation directory of the NonStop Server for Java.
When an SQL/MX application starts with a JREHOME setting, NonStop SQL/MX loads
the Java components from that JREHOME location into an SPJ environment created
for the application.
To set the JREHOME location, use one of these approaches:
Setting JREHOME by Using UDR_JAVA_OPTIONS on page 2-17
Setting the JREHOME Environment Variable on page 2-18
Each approach has a different scope and influence on CALL or CREATE
PROCEDURE statements.
Setting JREHOME by Using UDR_JAVA_OPTIONS
Use the UDR_JAVA_OPTIONS default attribute to set the JREHOME location in an
SPJ environment for an application or for all processes running on the node. The
UDR_JAVA_OPTIONS default attribute is particularly useful for NonStop ODBC/MX
applications, which cannot use environment variables set in the OSS or Guardian
environment.
To set the JREHOME location by using the UDR_JAVA_OPTIONS default attribute,
use this attribute value:
The java-installation-directory is the path of the installation directory of the
NonStop Server for Java.
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
Note. If you set the JREHOME location on a system running a G-series RVU, verify that the
same product version of the NonStop Server for Java is bound into the SQL/MX UDR server.
For more information, see Verifying the SQL/MX UDR Server on page 2-3.
'-Dsqlmx.udr.jrehome=java-installation-directory/jre'
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.