JDBC Driver for SQL/MX Programmer's Reference
Sample Programs Summary
JDBC Driver for SQL/MX includes sample Java programs that illustrate the features of the
product. The programs are described in the following table.
Sample Program Comments
sampleJdbcMx.java
Illustrates loading the JDBC for NonStop(TM)
SQL/MX driver and obtaining a JDBC connection
using the DriverManager interface.
CreateDataSource.java
and TestDataSource.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).
MultiThreadTest.java
Demonstrates the nonblocking JDBC/MX driver
feature. By default, this program creates two
threads. In nonblocking mode, these two threads
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 nowait mode. When the
program runs in nonblocking mode, you can
observe many thread switches.
holdJdbcMx.java
Illustrates the holdable cursor support in the
JDBC/MX driver. The program creates a
subscriber thread that subscribes to a message
queue. When all the rows in the message queue are
read, the subscriber times out after five seconds.