JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)
3 Accessing SQL Databases with SQL/MX
This section describes the following topics:
• “Connecting to SQL/MX” (page 21)
• “JdbcRowSet Implementation” (page 25)
• “JDBC/MX Properties” (page 25)
• “Transactions” (page 33)
• “Stored Procedures” (page 34)
• “SQL Context Management” (page 34)
• “Holdable Cursors” (page 35)
• “Connection Pooling” (page 35)
• “Statement Pooling” (page 37)
• “Using Additional JDBC/MX Properties” (page 39)
• “Supported Character Set Encodings” (page 42)
Connecting to SQL/MX
A Java application can obtain a JDBC connection to SQL/MX in two ways:
• Using the DriverManager class
• Using the DataSource interface
Connecting Using the DriverManager Class
This is the traditional way to establish a connection to the database. The DriverManager class
works with the Driver interface to manage the set of drivers loaded. When an application issues
a request for a connection using the DriverManager.getConnection method and provides
a URL, the DriverManager is responsible for finding a suitable driver that recognizes this URL
and obtains a database connection using that driver.
com.tandem.sqlmx.SQLMXDriver is the JDBC/MX driver class that implements the Driver
interface. The application can load the JDBC/MX driver in one of the following ways, except as
noted in the Table 3 (page 22) table.
• Specifying the JDBC/MX driver class in the -Djdbc.drivers option in the command line.
• Using the Class.ForName method within the application.
• Adding the JDBC/MX driver class to the jdbc.drivers property within the application.
The DriverManager.getConnection method accepts a string containing a JDBC URL. The
JDBC URL for the JDBC/MX driver is jdbc:sqlmx:.
When connecting by using the DriverManager class, use the information in the following topics:
• “JDBC/MX Driver Properties Used with the DriverManager Class” (page 21)
• “Guidelines for Using Connections with the DriverManager Class” (page 23)
JDBC/MX Driver Properties Used with the DriverManager Class
JDBC/MX driver defines the following set of properties that you can use to configure the driver:
Connecting to SQL/MX 21










