JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)
NOTE: Do not add the jdbcmx. prefix to the property name when the properties are given as a
parameter to the connection method or when using the data source. The prefix is not needed to
identify the property type because the property is being passed to a JDBC/MX driver object. Use
the jdbcmx. prefix only in the command line as described under “Setting Properties in the Command
Line” (page 31).
Guidelines for Using Connections with the DriverManager Class
• Java applications can specify the properties in the following ways:
Using JDBC/MX properties with the -D option in the command line. If used, this option
applies to all JDBC connections using the DriverManager within the Java application.
The format is to enter the following in the command line:
◦
-Djdbcmx.property_name=property_value
For example in a command line, -Djdbcmx.maxStatements=1024
◦ Using the java.util.properties parameter in the getConnection method of
DriverManager.
• The properties passed through the java.util.properties parameter have a higher
precedence over the command-line properties.
• The connection pooling feature is available when the Java application uses the
DriverManager class to obtain a JDBC connection. The connection pool size is determined
by the maxPoolSize property value and minPoolSize property value.
• The JDBC/MX driver has a connection-pool manager for a combination of catalog and schema;
therefore, connections with the same catalog and schema combinations are pooled together.
The connection pooling property values that are used at the time of obtaining the first connection
for a given catalog and schema combination is effective throughout the life of the process.
An application cannot change these property values subsequent to the first connection for a
given catalog and schema combination.
• As in the basic DataSource object implementation, a Java application can enable statement
pooling by setting the property to a non-zero positive value.
Connecting Using the DataSource Interface
The DataSource interface, introduced in the JDBC 2.0 optional package, is the preferred way
to establish a connection to the database because it enhances the application portability. The
JDBC/MX driver implements the DataSource interface and returns a connection object when an
application requests a connection using the getConnection method in the DataSource interface.
Using a DataSource object increases the application portability 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 DataSource object by means of a naming service
that uses the Java Naming and Directory Interface (JNDI).
Section (page 7) describes the properties that you can use to identify a JDBC/MX data source
object:
Table 4 DataSource Object Properties
DescriptionValueTypeProperty Name
Communicates with JDBC driver to continue the
remaining jobs in the batch even after any
on or offStringcontBatchOnError
Connecting to SQL/MX 23










