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

Scope of JVM Startup Options in an MXCI Session
During an MXCI session, you can issue a CONTROL QUERY DEFAULT statement that sets the
UDR_JAVA_OPTIONS default attribute. This setting applies only to CALL statements that you issue
in MXCI after you issue the CONTROL QUERY DEFAULT statement.
For example, the first CONTROL QUERY DEFAULT statement sets the class path for the SPJ
environment of subsequent CALL statements that you issue in MXCI. When you call the LOWERPRICE
procedure after issuing the CONTROL QUERY DEFAULT statement, the JVM uses the
/usr/otherclasses class path to search for and load classes that are not in the external path
of that SPJ. The second CONTROL QUERY DEFAULT statement resets the UDR_JAVA_OPTIONS
setting to the class path in effect, if any, at the start of the current MXCI session:
>>CALL samdbcat.sales.monthlyorders(1,?);
NUMBER
-----------
1
--- SQL operation complete.
>>CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS
'-Djava.class.path=/usr/myclasses';
--- SQL operation complete.
>>CALL samdbcat.sales.lowerprice();
--- SQL operation complete.
>>CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS RESET;
--- SQL operation complete.
For more information about MXCI, see the SQL/MX Reference Manual.
Displaying the UDR_JAVA_OPTIONS in Effect for an MXCI Session
To show the UDR_JAVA_OPTIONS setting in effect for a CONTROL QUERY DEFAULT statement
issued in MXCI, enter the SHOWCONTROL command in the current MXCI session. For more
information about SHOWCONTROL, see the SQL/MX Reference Manual.
Using Multiple UDR_JAVA_OPTIONS Settings in One Application
In the same application, you can set multiple UDR_JAVA_OPTIONS, each of which controls the
JVM startup options in an SPJ environment. Two or more UDR_JAVA_OPTIONS settings are
considered different or identical, depending on how you specify them in CONTROL QUERY
DEFAULT statements. See Determining the Uniqueness of UDR_JAVA_OPTIONS Settings (page 39).
If you specify different UDR_JAVA_OPTIONS settings in the same application, be aware of the
Performance Considerations of Using Multiple UDR_JAVA_OPTIONS Settings (page 40).
Determining the Uniqueness of UDR_JAVA_OPTIONS Settings
Two or more UDR_JAVA_OPTIONS settings are considered to be different when their character
string literals do not match during a case-sensitive string comparison. The case, white space, and
order in which the options appear within each character string literal must be the same for
UDR_JAVA_OPTIONS settings to be considered identical.
For example, these UDR_JAVA_OPTIONS settings in separate CONTROL QUERY DEFAULT
statements are considered to be the same:
CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS
'-Xmx32M -Djava.class.path=/usr/otherclasses';
Controlling JVM Startup Options 39