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

JDBC API Packages
The JDBC/MX API packages are shipped with the JDBC/MX driver software. For the API
documentation, see the JDBC/MX Driver for NonStop SQL/MX for H50 API Reference in the
H-series library in the NonStop Technical Library at Business Support Center (BSC).
The java.sql and javax.sql packages are included as part of Java 2, Standard Edition (J2SE)
SDK 1.5 and, therefore, are available with the core APIs delivered with the NonStop Server for
Java 5 product.
Sample Programs Summary
The JDBC/MX driver product includes sample Java programs that illustrate the features of the
product. The programs are described in Table 2 (page 16).
Table 2 Sample Programs Summary
CommentsSample Program
Illustrates loading the JDBC/MX driver and obtaining a JDBC connection
using the DriverManager interface.
sampleJdbcMx.java
Illustrates making a connection by using the DataSource interface,
thereby avoiding embedding driver-specific codes in the Java programs.
CreateDataSource.java creates the SQLMXDataSource object
and registers the object with the Java Naming and Directory Interface
(JNDI).
CreateDataSource.java and
TestDataSource.java
Demonstrates the non blocking JDBC/MX driver feature. By default, this
program creates two threads. In non blocking mode, these two threads
MultiThreadTest.java
run concurrently. This program displays the thread ID and status of the
SQL operation before and after each operation. When the program
runs in blocking mode, you observe only one thread switch because the
begin-transaction operation starts a transaction in SQL no wait mode.
When the program runs in non blocking mode, you can observe many
thread switches.
Illustrates the holdable cursor support in the JDBC/MX driver. The
program creates a subscriber thread that subscribes to a message queue.
holdJdbcMx.java
When all the rows in the message queue are read, the subscriber times
out after five seconds.
Demonstrates the benefits of connection pooling and statement pooling.
This program performs a loop for a 100 times that makes a JDBC
TestConnectionPool.java
connection, runs a few SQL statements, and closes the connection. You
use the OSS time() command to measure the performance benefits
of connection pooling and statement pooling in this program.
Demonstrates tracing by creating a wrapper around the driver-specific
data source to be traced. These demonstration programs are located in
the /demo directory of the product installation directory.
CreateTraceDS.java
nl
TestTraceDS.java
Demonstrates how to create an SQLMXJdbcRowSet object and invoke
several JdbcRowSet methods.
JdbcRowSetSample.java
Demonstrates the LOB feature in the JDBC/MX driver.LobSample.java
Demonstrates internal, external, and mixed transaction modes.TransactionMode.java
Demonstrates the “ISO88591 Property” (page 27).ISO88591Sample.java
For information on running these sample programs, see the README file provided with the JDBC/MX
driver software.
16 Introduction to JDBC/MX Driver