NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.0+)

JDBC Driver Types
The following table describes the types of JDBC drivers.
JDBC Driver Types
Type
Written in Java Description
No. Name
1 JDBC-to-ODBC bridge Possibly Uses a JDBC-to-ODBC bridge to translate JDBC calls into ODBC calls,
which are handled by an ODBC driver. This requires an ODBC driver on
the client side and an ODBC server on the server side.
2 Native protocol Partially Translates JDBC calls into the native API for a particular database. The
driver must run on a machine where this native API is available. (sqlmp
and sqlmptx are Type 2 drivers.)
3 Pure Java Entirely Translates JDBC calls into a database-independent protocol for
transmission over the network. Server middleware then translates this
protocol into a database's native protocol.
4 Native protocol,
Pure Java
Entirely Translates JDBC calls directly into the network protocol of a particular
database. Thus, a JDBC program on the client can call directly to the
database server.
Note: Compaq does not support third-party JDBC drivers, but any JDBC driver that is written entirely in
Java (that is, a Type 3 or a Type 4 driver) can run on top of NSJ. To use such a driver to connect your Java
program to a third-party database, see the third-party instructions for that driver.
This subsection explains these subjects:
Original SQL/MP Driver
Transaction-Aware SQL/MP Driver
Original SQL/MP Driver
The original SQL/MP driver, sqlmp, manages transactions itself. You do not need to explicitly begin and end
transactions using Current class methods.
Note: If you call the original driver after beginning a transaction using Current.begin() (that is, if you
create an active transaction in the thread), the driver throws an SQLMPException.
By default, the original driver connects to an SQL/MP database using autocommit mode, but it can also use
nonautocommit mode.
The following table shows how the original driver behaves when the JDBC method
Connection.createStatement() or Connection.prepareStatement() is called, depending on the
connection mode and whether an active transaction exists in the thread.
Effect of Mode and Transaction Status on Original Driver
Transaction Status
Active transaction in thread No active transaction in thread
M
o
d
e
Autocommit
(default)
Throws an SQLMPException.
Creates a new transaction for each statement.
Nonautocommit
Throws an SQLMPException.
Creates a new transaction for this connection.