JDBC Type 4 Driver Programmer's Reference
java.util.properties parameter have a higher precedence over the command-line properties.❍
command-line properties have a higher precedence over file properties set through the -Dt4sqlmx.properties option.❍
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 Type 4 driver has a connection-pool manager for a combination of catalog, schema, username, and serverDataSource.
Therefore, connections with the same catalog, schema, username, and serverDataSource combinations are pooled together. The
connection pooling property values that are used at the time of obtaining the first connection for a given catalog, schema,
username, and serverDataSource 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, schema, username, and serverDataSource 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.
●
Connection Using the DataSource Interface
The javax.sql.DataSource interface is the preferred way to establish a connection to the database because it enhances the
application portability. The Type 4 driver implements the javax.sql.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 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 javax.sql.DataSource object by means
of a naming service that uses the Java Naming and Directory Interface (JNDI).
The following table describes the properties that you can use to identify a Type 4 driver data source object:
DataSource Object Properties
Property Name Type Value Description
catalog String
See catalog.
If the default catalog and schema
are not specified, the Type 4 driver
allows SQL/MX to follow its own
rules for defaults.
schema String
See schema
See catalog above.
dataSourceName String
The registered
ConnectionPoolDataSource
name. When this string is empty,
connection pooling is used by
default with the pool size
determined by the maxPoolSize
property and minPoolSize
property of the basic
DataSource object.
description String
Any valid identifier The description of the data source.
maxPoolSize int
See maxPoolSize
Property.
Sets maximum number of physical
connections that the pool could
contain. This number includes both
free connections and connections in
use.
maxStatements int
See maxStatements
Property.
The total number of
PreparedStatement objects
that the connection pool should
cache.
minPoolSize int
See minPoolSize
Property.
Limits the number of physical
connections that can be in the free
connection pool.