JDBC Type 4 Driver 2.0 Programmer's Reference (SQL/MX 2.x)
Guidelines for Connections Using the Driver Manager
The Type 4 driver defines a set of properties that you can use to configure the driver. For detailed information about
these properties, see the Type 4 Driver Properties chapter.
●
Java applications can specify the properties in the following ways (listed in the order of precedence):
Using the java.util.Properties parameter in the getConnection method of DriverManager class.1.
Using the database URL in the DriverManager.getconnection method, where the URL is:
jdbc:t4sqlmx: //ip_addr|machine_name:port_num/property=value
2.
Using a properties file for the JDBC driver. The properties file is passed as a command-line parameter. The format
to enter the properties file in the command line is:
-Dt4sqlmx.properties=location-of-the-properties-file-on-disk
For example, -Dt4sqlmx.properties=C:\temp\t4props
For information about the properties file, see Creating and Using a Properties File in the Type 4 Driver Properties
chapter.
3.
Using JDBC 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 in the command line is:
-Dt4sqlmx.property_name=property_value
For example, -Dt4sqlmx.maxStatements=1024
4.
●
Stored Procedures
Java applications can use the JDBC standard CallableStatement interface to run stored procedures (SPJs) by using the
CALL statement. For more information, see the SQL/MX Guide to Stored Procedures in Java.
The following SPJ features are not supported:
executeBatch for callableStatements
●
setXXX() methods with parameter names instead of parameter numbers●
The feature of SPJ returning a java.sql.ResultSet is available from T1249V20^ABT. This feature is available only
from ODBC/MX SERVICES and ODBC/MX SERVER, compliant with SQL/MX 2.3.2.
Connection Pooling
The Type 4 driver provides an implementation of connection pooling, where a cache of physical database connections are
assigned to a client session and reused for the database activity. If connection pooling is active, connections are not physically
closed. The connection is returned to its connection pool when the Connection.close() method is called. The next time
a connection is requested by the client, the driver will return the pooled connection, and not a new physical connection.
The connection pooling feature is available when the JDBC application uses either the DriverManager class or
DataSource interface to obtain a JDBC connection. The connection pool size is determined by the maxPoolSize
property value and minPoolSize property value.
●
By default, connection pooling is disabled. To enable connection pooling, set the maxPoolSize property to an integer
value greater than 0 (zero).
●
Manage connection pooling by using the following Type 4 driver properties:
maxPoolSize❍
●










