SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
Displaying the UDR_JAVA_OPTIONS in Effect for a Node
To show the UDR_JAVA_OPTIONS setting in effect for the system, enter the SHOWCONTROL ALL
command in an MXCI session. For more information about SHOWCONTROL, see the SQL/MX
Reference Manual.
JVM Startup Options for Each SPJ Caller
To set JVM startup options for each caller of an SPJ, use a CONTROL QUERY DEFAULT statement.
A UDR_JAVA_OPTIONS setting in a CONTROL QUERY DEFAULT statement takes precedence over
the system-defined default setting, which is OFF, and settings in the SYSTEM_DEFAULTS table.
For the effect of the UDR_JAVA_OPTIONS setting on different callers, see:
• Scope of JVM Startup Options in an SPJ Method (page 37)
• Scope of JVM Startup Options in Statically Compiled Applications (page 37)
• Scope of JVM Startup Options in Dynamically Compiled Applications (page 38)
• Scope of JVM Startup Options in an MXCI Session (page 39)
For information about the syntax of the CONTROL QUERY DEFAULT statement, see the SQL/MX
Reference Manual.
Scope of JVM Startup Options in an SPJ Method
A UDR_JAVA_OPTIONS setting within an SPJ method does not affect the SPJ environment in which
the SPJ is executing. It affects only the SPJ environment of CALL statements that the SPJ method
executes. In general, avoid nesting CALL statements in an SPJ. For more information, see Nested
Java Method Invocations (page 53).
Scope of JVM Startup Options in Statically Compiled Applications
The UDR_JAVA_OPTIONS setting in a statically compiled CONTROL QUERY DEFAULT statement
affects statically compiled CALL statements in the line order scope of the application.
For example, this CONTROL QUERY DEFAULT statement in an embedded SQL program in C affects
the maximum Java heap size of the SPJ environment in which the next statically compiled CALL
statement executes:
/* Set application-specific system properties for
/* the SPJ environment. */
EXEC SQL CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS '-Xmx32M';
/* Call the stored procedure. */
EXEC SQL CALL samdbcat.sales.lowerprice();
/* Turn off the application-specific system properties for
/* the SPJ environment. */
EXEC SQL CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS 'OFF';
/* Call the stored procedure. */
EXEC SQL CALL samdbcat.sales.lowerprice();
...
CALL statements that are statically compiled after the CONTROL QUERY DEFAULT statement turns
off the UDR_JAVA_OPTIONS setting execute in an SPJ environment without application-specific
startup options.
For more information about the semantics of static CONTROL statements in embedded SQL
programs, see the SQL/MX Programming Manual for C and COBOL or the SQL/MX Programming
Manual for Java.
Controlling JVM Startup Options 37










