SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
NOTE: If you specify an alternate JDBC/MX location by using the -Dsqlmx.udr.extensions
option and jdbcMx.jar does not exist at that location, NonStop SQL/MX uses the standard
location for jdbcMx.jar.
Setting the JDBC/MX Location by Using UDR_JAVA_OPTIONS
Use the UDR_JAVA_OPTIONS default attribute to set the JDBC/MX location in an SPJ environment
for an application or for all processes running on the node.
To set the JDBC/MX location by using the UDR_JAVA_OPTIONS default attribute, use this attribute
value:
'-Dsqlmx.udr.extensions= jdbcmx-jar-filepath'
The jdbcmx-jar-filepath is the JAR file path of jdbcMx.jar.
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 the JDBC/MX Location in UDR_JAVA_OPTIONS
A JDBC/MX location set by a CONTROL QUERY DEFAULT statement affects the SPJ environment
of subsequent CALL or CREATE PROCEDURE statements. This JDBC/MX 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 JDBC/MX location before a CALL statement in an application:
CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS
'-Dsqlmx.udr.extensions=/usr/tandem/jdbcMx/T1225V311/lib/jdbcMx.jar';
CALL...
A JDBC/MX setting inserted into the SYSTEM_DEFAULTS table affects all CALL or CREATE
PROCEDURE statements that run on the system. This JDBC/MX 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 JDBC/MX 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.extensions=/usr/tandem/jdbcMx/T1225V311/lib/jdbcMx.jar');
For more information about the scope of the UDR_JAVA_OPTIONS setting, see Controlling JVM
Startup Options (page 36).
Precedence of the JDBC/MX Location in UDR_JAVA_OPTIONS
The CONTROL QUERY DEFAULT setting overrides the UDR_JAVA_OPTIONS setting in the
SYSTEM_DEFAULTS table.
Setting the Class Path
The class path contains an ordered list of directories and JAR files in which to search for Java class
files. If an SPJ method refers to another application class (for example, loads a class, creates an
object of a class, or invokes a method of another class), the other class must either be in the same
external path location as the SPJ class or have its location specified in the class path.
Setting the Class Path 43










