JDBC Type 4 Driver Programmer's Reference for SQL/MX Release 3.1 (H06.23+, J06.12+)
Data Sources
JDBC Data Source (client-side)
MXCS Data Source (server-side)
The term data source logically refers to a database or other data storage entity. In this manual, two concepts of data source concepts apply:
A JDBC (client) data source, which is physically a Java object that contains properties such as the URL of the physical database, the catalog
to use when to this database, and the schema to use when to this database. The JDBC data source also contains methods for obtaining a
JDBC connection to the underlying database.
An MXCS (server) data source, which is physically a set of information that is created and managed by MXCS. This data source contains
configuration information, which defines the semantics of MXCS servers created with that server data source.
JDBC Data Source (client-side)
All JDBC data source classes implement either the javax.sql.DataSource interface or the javax.sql.ConnectionPoolDataSource interface. The
Type 4 driver data source classes are com.tandem.t4jdbc.SQLMXDataSource and com.tandem.t4jdbc.SQLMXDataSource. (These classes are
defined by the JDBC 3.0 specification.) The
Type 4 driver implements javax.sql.XADataSource, java.transaction.xa.XAResource to support
distributed transactions.
Typically, a user or system administrator use a tool to create a data source, and then register the data source by using a JNDI service provider.
At run time, a user application typically retrieves the data source through JNDI, and uses the data source’s methods to establish a connection to
the underlying database.
A
DataSource object maps to an instance of a database. In the Type 4 driver product, the DataSource object acts as an interface between the
application code and the database, and enables connection with an MXCS data source.
MXCS Data Source (server-side)
Server data sources reside on a NonStop server. Each server data source represents a pool of SQL MXCS servers that share the same
NonStop SQL context. A server data source is typically created by a NonStop system administrator, who defines the semantics of all
connections made through that server data source. For example, the server data source contains information on how many MXCS servers can
be in its corresponding pool and how many connections can be handled through this data source.
For information on configuring MXCS XA data source, see the SQL/MX Connectivity Service Manual.
Security
Clients connect to the MXCS server with a valid Guardian user name and ID, using standard JDBC 3.0 APIs. An application can make multiple
connections to MXCS using different user IDs, and creating different connection objects.
The
Type 4 driver provides for user name and password authentication before to MXCS. The password is encrypted with a proprietary
algorithm provided by the MXCS product.
Note: There is no secure wire communication such as SSL provided for the communication between Type 4 driver and the
MXCS server.
How to Make a Connection to SQL/MX
A Java application can obtain a JDBC connection to NonStop SQL/MX in two ways:
By using the DataSource interface (the preferred method)
By using the DriverManager class
Connection by Using the DataSource Interface
Overview of Tasks to Deploy DataSource Objects
DataSource Object Properties
Programmatically Creating an Instance of the DataSource Class
Programmatically Registering the DataSource Object
Retrieving a DataSource Instance by using JNDI and to the Data Source
Specifying the Properties File that Configures the Data Source
The javax.sql.DataSource interface is the preferred way to establish a connection to the database because this interface enhances the
application portability. Portability is achieved by allowing the application to use a logical name for a data source instead of providing driver-
specific information in the application. A logical name is mapped to a javax.sql.DataSource object through a naming service that uses the Java
Naming and Directory Interface (JNDI). Using this
DataSource method is particularly recommended for application servers.
Observe that two types of data sources interact here as described under
Data Sources.










