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

A Sample SPJs
This appendix presents the SPJs that are shown in examples throughout this manual. For descriptions
of the SPJ methods and the CREATE PROCEDURE statements that register those methods in an
SQL/MX database, see:
Class Files and Java Methods (page 106)
The createprocs.sql File (page 111)
Examples of the Sample SPJs (page 113)
Using Sample SPJs
The SPJ methods are coded in Java source files, which are located in a JAR file named Sam
pleSPJs.jar in the NonStop Technical Library (NTL).
Installing the SampleSPJs.jar File
1. In NTL, navigate to the H06.04G06.23 or later RVU.
2. From the Categories list, select Sample Programs.
3. Under Publications, select SQL/MX Stored Procedures in Java (SPJs).
4. Follow the instructions in NTL for downloading the SampleSPJs.jar file to your PC
workstation.
5. On your PC, use WinZip to open the SampleSPJs.jar file and view the README.txt file,
which explains how to use SampleSPJs.jar.
To use the source files in SampleSPJs.jar, place the JAR file in the desired OSS directory,
extract the source files, and compile them by using the Java programming language compiler. See
Figure 11 (page 106).
Installing the SQL/MX Sample Database
The SPJs rely on the SQL/MX sample database (product T0517) to run properly. All the sample
SPJs can query both SQL/MP and SQL/MX tables of the SQL/MX sample database. To query
SQL/MP tables, use the NonStop SQL/MX Release 1.8 sample database. To query SQL/MX
tables, use the NonStop SQL/MX Release 2.x sample database.
NOTE: The SQL/MX Release 2.x sample database uses SQL/MX format tables. To install the
sample database, you must have a license to use SQL/MX DDL statements. To acquire this license,
purchase product T0394. Without this product, you cannot install the sample database. An error
message informs you that the system is not licensed.
To install the sample database, see the SQL/MX Quick Start. For information about the schema
and tables of the sample database, see the SQL/MX Reference Manual.
Using Sample SPJs 105