SQL/MX Guide to Stored Procedures in Java (G06.24+, H06.03+)

Introduction
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
1-8
Effect of Invoking an SPJ
Effect of Invoking an SPJ
When an application issues a CALL statement, the Java method of the invoked SPJ
executes inside a JVM in an SQL/MX UDR server process. Figure 1-3 shows how
SQL/MX processes a CALL statement.
1. An SQL/MX application invokes an SPJ by issuing a CALL statement. The
SQL/MX executor reads the compiled SQL plan for the CALL statement.
2. The SQL/MX executor checks the procedure label to verify that the caller has
permission to invoke the SPJ.
3. If the caller has permission to invoke the SPJ, the SQL/MX executor starts sending
messages to the SQL/MX UDR server (shown as the MXUDR executable in
Figure 1-3) to execute the SPJ. The SQL/MX executor sends any input parameters
that the application passes to the SPJ to the SQL/MX UDR server.
4. Inside the SQL/MX UDR server process, an SPJ class loader loads the class
specified by the SPJ and executes the SPJ method.
5. The SQL/MX UDR server returns the output parameters of the SPJ to the SQL/MX
executor, and the SQL/MX executor returns the output to the application. If
exceptions occur during the execution of the Java method, the SQL/MX UDR
server returns them to the SQL/MX executor as SQL diagnostics.
Figure 1-3. Invoking an SPJ
VST003.vsd
/usr/mydir/Payroll.class
Procedure Label
Application
NonStop
SQL/MX
MXUDR
JVM
SQL Plan
3
1
2
4
5
CALL...