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

HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
A-1
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 on page A-3
The createprocs.sql File on page A-11
Examples of the Sample SPJs on page A-13
Using Sample SPJs
The SPJ methods are coded in Java source files, which are located in a JAR file
named SampleSPJs.jar in the NonStop Technical Library (NTL).
Installing the SampleSPJs.jar File
1. In NTL, navigate to the G06.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 A-1 on page A-2.
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.
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.
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.