JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)

Stored Procedures
SQL/MX provides support for stored procedures with result sets, which are written in Java and run
under an SQL/MX execution environment.
Stored procedures can be run in SQL/MX by using the CALL statement. The JDBC/MX driver allows
stored procedures to be called by using the standard JDBC API escape syntax for stored procedures.
The escape SQL syntax is:
{call procedure-name([arg1,arg2, ...])}
where argn refers to the parameters sequentially, with the first parameter being arg1. For more
information about the non-escape syntax of the CALL statement, see the HP NonStop SQL/MX
Release 3.2.1 Reference Manual.
Java applications can use the JDBC standard CallableStatement interface to run stored
procedures in SQL/MX by using the CALL statement. For more information, see the SQL/MX Guide
to Stored Procedures in Java.
Limitations
Limitations of the stored procedures in Java (SPJs) are:
The stored procedures in Java (SPJs) do not support result sets returned from the Java method
that contain CLOB or BLOB data types.
SPJs do not support SHORTANSI names.
NOTE: Do not use the SHORTANSI name type with SPJs.
SQL Context Management
NonStop SQL/MX allows you to manage SQL/MX contexts. An SQL/MX context can be considered
as an instance of the SQL/MX executor that has its own execution environment that contains the
following:
CONTROL and SET information
A transaction
An SQL/MX compiler process (MXCMP)
Set of SQL/MX executive server processes (ESPs)
User-created SQL statements
The JDBC/MX driver maps a JDBC connection to an SQL/MX context. Therefore, in a multi-threaded
application, a JDBC application has multiple SQL/MX compiler processes (MXCMP processes)
associated with the application. An SQL/MX context is created when the application obtains a
JDBC connection. An SQL/MX context is destroyed when the application explicitly or implicitly
closes the JDBC connection.
The following JDBC connection attributes are passed to the SQL/MX context by the JDBC/MX
driver by executing the corresponding SQL statements:
Table 6 Connection Attributes Passed to the SQL/MX Context
SQL StatementAttribute
SET CATALOG default-catalog-name
catalog
SET SCHEMA default-schema-name
schema
SET MPLOC default-location
mploc
SET TRANSACTION isolation-level
transaction isolation
34 Accessing SQL Databases with SQL/MX