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-6
SPJs in NonStop SQL/MX
SPJs in NonStop SQL/MX
This subsection explains the process and effect of registering and invoking SPJs in
NonStop SQL/MX:
Effect of Registering an SPJ on page 1-6
Effect of Invoking an SPJ on page 1-8
Invoking Different Types of SPJs on page 1-9
Effect of Registering an SPJ
When you register an SPJ by using a CREATE PROCEDURE statement, NonStop
SQL/MX verifies that the specified Java method exists and that its signature matches
the SQL parameters of the stored procedure. After verifying the SPJ, NonStop SQL/MX
stores information about the SPJ method, such as its name, location, and parameter
types, in the system metadata tables. After you register an SPJ in NonStop SQL/MX,
any SQL/MX application or interface with the appropriate permissions can call the SPJ
to execute the SPJ method.
Figure 1-2 shows how NonStop SQL/MX processes a CREATE PROCEDURE
statement.
1. The CREATE PROCEDURE statement that the application issues is processed by
an SQL/MX compiler (MXCMP) process.
Figure 1-2. Registering an SPJ
VST002.vsd
Application
MXCMP
MXUDR
JVM
/usr/mydir/Payroll.class
Procedure Label
SQL/MX Metadata Tables
4
Populates SQL/MX system
metadata.
2
Invokes an
internal SPJ
for validation.
Creates a
procedure label
for the SPJ.
5
3
Does the Java
method exist?
1
CREATE PROCEDURE...