4 DB2 Driver : Connection Properties

Connection Properties
This section lists the JDBC connection properties supported by the DB2 driver and describes each property. The properties have the form:
property=value
You can use these connection properties with either the JDBC Driver Manager or DataDirect Connect Series for JDBC data sources unless otherwise noted.
NOTES:
■
All connection property names are case-insensitive. For example, Password is the same as password. Required properties are noted as such.
■
AccountingInfo
Description
Accounting information to be stored in the database. This property sets the CURRENT CLIENT_ACCTNG register (DB2 for Linux/UNIX/Windows) or the CLIENT ACCTNG register (DB2 for z/OS and DB2 for iSeries) in the database. This value is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is the accounting information.
NOTE: Your database may impose character length restrictions on the value. If the value exceeds a restriction, the driver truncates it.
Default
empty string
Data Type
String
See Also
“Using Client Information”
AddToCreateTable
Description
A string that is appended to the end of all CREATE statements. This property can be used to add an "in database" clause.
Valid Values
string
where string is the set of characters appended to all CREATE statements.
Default
None
Data Type
String
AllowImplicitResultSetCloseForXA
Description
Specifies whether result sets in distributed transactions are automatically closed when all rows of the result sets have been returned.
Valid Values
true | false
If set to true, the driver automatically closes result sets in distributed transactions when all rows of the result sets have been returned.
If set to false, the driver does not automatically close result sets in distributed transactions when all rows of the result sets have been returned. Because automatically closing results sets in distributed transactions does not work correctly with DB2 V8.1 for Linux/UNIX/Windows servers prior to Fix Pack 5, use this value if your application accesses DB2 V8.1 for Linux/UNIX/Windows prior to Fix Pack 5.
Default
true
Data Type
boolean
AlternateID
Description
The name of the schema to be used to qualify unqualified database objects in dynamically prepared SQL statements.
For DB2 for Linux/UNIX/Windows and DB2 for iSeries, this property sets the value in the DB2 CURRENT SCHEMA special register.
For DB2 for z/OS, this property sets the value in the DB2 CURRENT SQLID special register.
Valid Values
For DB2 for Linux/UNIX/Windows and DB2 for iSeries, a valid DB2 schema name. This value is not validated by the database server.
For DB2 for z/OS, this value is validated by the database server. Refer to your IBM documentation for valid values for the CURRENT SQLID register.
Default
None
Data type
String
AlternateServers
Description
A list of alternate database servers that is used to failover new or lost connections, depending on the failover method selected. See the FailoverMode property for information about choosing a failover method.
Valid Values
(servername1[:port1][;property=value[;...]][,servername2[:port2]
[;property=value[;...]]]...)
The server name (servername1, servername2, and so on) is required for each alternate server entry. Port number (port1, port2, and so on) and connection properties (property=value) are optional for each alternate server entry. If the port is unspecified, the port number of the primary server is used. If the port number of the primary server is unspecified, the default port number of 50000 is used.
Optional connection properties are DatabaseName (DB2 for Linux/UNIX/Windows) and LocationName (DB2 for z/OS and DB2 for iSeries).
NOTE: If using failover with DB2 High Availability Disaster Recovery (HADR), the primary server and any alternate server must be the primary server and a standby server, respectively, that is configured in your HADR system.
Example
The following URL contains alternate server entries for server2 and server3. The alternate server entries contain the optional DatabaseName property.
jdbc:datadirect:db2://server1:50000;DatabaseName=TEST;User=test;
Password=secret;AlternateServers=(server2:50000;DatabaseName=TEST2,
server3:50000;DatabaseName=TEST3)
Default
None
Data type
String
See Also
“Configuring Failover”
ApplicationName
Description
The name of the application to be stored in the database. This property sets the CURRENT CLIENT_APPLNAME register (DB2 for Linux/UNIX/Windows) or CLIENT APPLNAME register (DB2 for z/OS and DB2 for iSeries) in the database. For DB2 V9.1 and higher for Linux/UNIX/Windows, it also sets the APPL_NAME column of the SYSIBMADM.APPLICATIONS table. These values are used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is the name of the application.
NOTE: Your database may impose character length restrictions on the value. If the value exceeds a restriction, the driver truncates it.
Default
empty string
Data Type
String
See Also
“Using Client Information”
AuthenticationMethod
Description
Determines which authentication method the driver uses when it is establishes a connection.
When user ID/password authentication is used, the encryption method that is used for user IDs and passwords is negotiated during the connection process. Supported encryption methods are:
■
■
To use AES encryption, the following requirements and restrictions apply:
■
●
DB2 V9.x for Linux/UNIX/Windows
●
●
●
■
The Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy files, which require Java SE 5 or higher, must be installed on the client or application server. You can obtain these files from the following URL:
http://java.sun.com/javase/downloads/index.jsp
■
■
■
AES encryption cannot be used if the EncryptionMethod property is set to a value of DBEncryption or requestDBEncryption.
Valid Values
clearText | client | encryptedPassword | encryptedPasswordAES | encryptedUIDPassword | encryptedUIDPasswordAES | kerberos
If set to clearText, the driver uses user ID/password authentication. The driver sends the user ID and password in clear text to the DB2 server for authentication. If a user ID and password are not specified, the driver throws an exception.
If set to client, the driver uses client authentication. The DB2 server relies on the client to authenticate the user and does not provide additional authentication. The driver ignores any user ID or password specified.
If set to encryptedPassword, the driver uses user ID/password authentication. The driver sends a user ID in clear text and an encrypted password to the DB2 server for authentication. If the requirements for AES encryption are met, the driver uses AES encryption; otherwise, the driver allows a downgrade to DES encryption. If the EncryptionMethod property is set to a value of DBEncryption or requestDBEncryption, the driver downgrades encryption to DES. If a user ID and password are not specified, the driver throws an exception.
If set to encryptedPasswordAES, the driver uses user ID/password authentication. The driver sends a clear text user ID and an AES-encrypted password to the DB2 server for authentication. The driver throws an exception in the following cases:
■
■
■
If the EncryptionMethod property is set to a value of DBEncryption or requestDBEncryption
If set to encryptedUIDPassword, the driver uses user ID/password authentication. The driver sends an encrypted user ID and password to the DB2 server for authentication. If the requirements for AES encryption are met, the driver uses AES encryption; otherwise, the driver allows a downgrade to DES encryption. If the EncryptionMethod property is set to a value of DBEncryption or requestDBEncryption, the driver downgrades encryption to DES. If a user ID and password are not specified, the driver throws an exception.
If set to encryptedUIDPasswordAES, the driver uses user ID/password authentication. The driver sends an AES-encrypted user ID and password to the DB2 server for authentication. The driver throws an exception in the following situations:
■
■
■
If the EncryptionMethod property is set to a value of DBEncryption or requestDBEncryption.
If set to kerberos, the driver uses Kerberos authentication. The driver ignores any user ID or password specified.
NOTE: The User property provides the user ID. The Password property provides the password. The EncryptionMethod property determines whether the driver uses data encryption.
Default
clearText
Data Type
String
See Also
“Authentication”
“Data Encryption”
BatchPerformanceWorkaround
Description
The driver uses the native DB2 batch mechanism. This property determines whether restrictions are enforced to facilitate data conversions.
Valid Values
true | false
If set to true, restrictions are removed; however, parameter sets may not be executed in the order that they were specified.
If set to false, the methods that are used to set the parameter values of a batch operation that is performed using a PreparedStatement must match the database data type of the column with which the parameter is associated. This is because DB2 servers do not perform implicit data conversions.
Default
false
Data Type
boolean
See Also
“Batch Inserts and Updates”
BulkLoadBatchSize
Description
Provides a suggestion to the driver for the number of rows to load to the database at a time when bulk loading data. Performance can be improved by increasing the number of rows the driver loads at a time because fewer network round trips are required. Be aware that increasing the number of rows that are loaded also causes the driver to consume more memory on the client.
NOTES:
■
This property suggests the number of rows regardless of which bulk load method is used: using a DDBulkLoad object or using bulk load for batch inserts.
■
The DDBulkObject.setBatchSize() method overrides the value set by this property. Refer to Chapter 2 “JDBC Extensions” in the DataDirect Connect for JDBC Reference for a description of the method.
Valid Values
x
where x is a positive integer that represents a number of rows.
Default
2048
Data Type
long
See Also
“Using DataDirect Bulk Load”
CatalogIncludesSynonyms
Description
DEPRECATED. Use the CatalogOptions property instead.
CatalogOptions
Description
Determines which type of metadata information is included in result sets when an application calls DatabaseMetaData methods.
Valid Values
0 | 2 | 6
If set to 0, result sets do not contain synonyms or remarks.
If set to 2, result sets contain synonyms and remarks that are returned from the following DatabaseMetaData methods: getColumns(), getExportedKeys(), getFunctionColumns(), getFunctions(), getImportedKeys(), getIndexInfo(), getPrimaryKeys(), getProcedureColumns(), and getProcedures().
If set to 6, a hint is provided to the driver to emulate getColumns() calls using the ResultSetMetaData object instead of querying database catalogs for column information. Result sets contain synonyms, but not remarks. Using emulation can improve performance because the SQL statement that is formulated by the emulation is less complex than the SQL statement that is formulated using getColumns(). The argument to getColumns() must evaluate to a single table. If it does not, because of a wildcard or null value, for example, the driver reverts to the default behavior for getColumns() calls.
Default
2
Data Type
int
See Also
“Performance Considerations”
CatalogSchema
Description
The DB2 schema to use for catalog methods. To improve performance, views of system catalog tables can be created in a schema other than the default catalog schema. Setting this property to a schema that contains views of the catalog tables allows the driver to use those views. To ensure that catalog methods function correctly, views for specific catalog tables must exist in the specified schema. The views that are required depend on your DB2 database. See “Non-Default Schemas for Catalog Methods” for views for catalog tables that must exist in the specified schema.
Valid Values
string
where string is the name of a valid DB2 schema.
Default
SYSCAT (DB2 for Linux/UNIX/Windows) | SYSIBM (DB2 for z/OS) | QSYS2 (DB2 for iSeries)
Data Type
String
See Also
“Performance Considerations”
CharsetFor65535
Description
The code page to be used by the driver to convert character data that is stored as bit data in character columns (Char, Varchar, Longvarchar, Char for Bit Data, Varchar for Bit Data, Longvarchar for Bit Data) defined with CCSID 65535. All character data that is stored as bit data and returned from the database using columns defined with CCSID 65535 is converted using the specified code page. This property has no effect when writing data to character columns that are defined with CCSID 65535.
Valid Values
string
where string is the name of a valid code page that is supported by your JVM.
Example
CP950
Default
None
Data Type
String
ClientHostName
Description
The host name of the client machine to be stored in the database. This property sets the CURRENT CLIENT_WRKSTNNAME register (DB2 for Linux/UNIX/Windows) or CLIENT WRKSTNNAME register (DB2 for z/OS and DB2 for iSeries) in the database. This value is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is the host name of the client machine.
NOTE: Your database may impose character length restrictions on the value. If the value exceeds a restriction, the driver truncates it.
Default
empty string
Data Type
String
See Also
“Using Client Information”
ClientUser
Description
The user ID to be stored in the database. This property sets the CURRENT CLIENT_USERID register (DB2 for Linux/UNIX/Windows) and CLIENT USERID register (DB2 for z/OS and DB2 for iSeries) in the database. This value is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is a valid user ID.
NOTE: Your database may impose character length restrictions on the value. If the value exceeds a restriction, the driver truncates it.
Default
empty string
Data Type
String
See Also
“Using Client Information”
CodePageOverride
Description
The code page to be used by the driver to convert Character and Clob data. The specified code page overrides the default database code page or column collation. All Character and Clob data that is returned from or written to the database is converted using the specified code page.
By default, the driver automatically determines which code page to use to convert Character data. Use this property only if you need to change the driver’s default behavior.
Valid Values
string
where string is the name of a valid code page that is supported by your JVM.
Example
CP950
Default
None
Data Type
String
ConcurrentAccessResolution
Description
Determines whether a read transaction can access committed rows that are locked by a write transaction when the application isolation level is Read Committed (DB2 Cursor Stability) or Repeatable Read (DB2 Read Stability).
This property is only valid for DB2 V9.7 for Linux/UNIX/Windows databases.
Valid Values
auto | useCurrentlyCommitted | waitForOutcome
If set to auto, the driver determines whether read transactions can access currently committed data when lock contention occurs by checking the setting of the DB2 cur_commit parameter on the database server. If the cur_commit parameter is set to ON, read transactions can access currently committed data.
If set to useCurrentlyCommitted, the driver allows read transactions to access currently committed data if the data is being updated or deleted. Read transactions skip rows that are being inserted.
If set to waitForOutcome, read transactions wait for a commit or rollback operation if they encounter data that is being updated or deleted. Read transactions do not skip rows that are being inserted.
Default
auto
Data Type
String
ConnectionRetryCount
Description
The number of times the driver retries connection attempts to the primary database server, and if specified, alternate servers until a successful connection is established.
NOTE: If an application sets a login timeout value (for example, using DataSource.loginTimeout or DriverManager.loginTimeout), and the login timeout expires, the driver ceases connection attempts.
Valid Values
0 | x
where x is a positive integer that represents the number of retries.
If set to 0, the driver does not try to reconnect after the initial unsuccessful attempt.
If set to x, the driver retries connection attempts the specified number of times. If a connection is not established during the retry attempts, the driver returns an exception that is generated by the last database server to which it tried to connect.
NOTE: The ConnectionRetryDelay property specifies the wait interval, in seconds, to occur between retry attempts.
Example
If this property is set to 2 and alternate servers are specified using the AlternateServers property, the driver retries the list of servers (primary and alternate) twice after the initial retry attempt.
Default
5
Data Type
int
See Also
“Configuring Failover”
ConnectionRetryDelay
Description
The number of seconds the driver waits between connection retry attempts when ConnectionRetryCount is set to a positive integer.
Valid Values
0 | x
where x is a number of seconds.
If set to 0, the driver does not delay between retries.
If set to x, the driver waits between connection retry attempts the specified number of seconds.
Example
If ConnectionRetryCount is set to 2, this property is set to 3, and alternate servers are specified using the AlternateServers property, the driver retries the list of servers (primary and alternate) twice after the initial retry attempt. The driver waits 3 seconds between retry attempts.
Default
1 (second)
Data Type
int
See Also
“Configuring Failover”
ConvertNull
Description
Controls how data conversions are handled for null values.
Valid Values
0 | 1
If set to 0, the driver does not perform the data type check if the value of the column is null. This allows null values to be returned even though a conversion between the requested type and the column type is undefined.
If set to 1, the driver checks the data type being requested against the data type of the table column that stores the data. If a conversion between the requested type and column type is not defined, the driver generates an "unsupported data conversion" exception regardless of the data type of the column value.
Default
1
Data Type
int
CreateDefaultPackage
Description
Determines whether the driver automatically creates required DB2 packages.
For DB2 for Linux/UNIX/Windows, this property must be used in conjunction with the ReplacePackage property.
For DB2 for z/OS and DB2 for iSeries, DB2 packages are created in the collection or library that is specified by the PackageCollection property.
Valid Values
true | false
If set to true, the driver automatically creates required DB2 packages, even if they already exist. Existing DB2 packages are replaced by the new packages.
If set to false, the driver determines if the required DB2 packages exist. If they do not, the driver automatically creates them.
Default
false
Data Type
boolean
See Also
“DB2 Packages”
CurrentFunctionPath
Description
A list of DB2 schema names that are used to resolve unqualified function names and data type references in dynamically prepared SQL statements. It also is used to resolve unqualified stored procedure names that are specified in CALL statements. This property sets the CURRENT PATH register in the database.
Valid Values
schema_name[[,schema_name]...]
where schema_name is a valid DB2 schema name.
Default
null
Data Type
String
CurrentQueryOptimization
Description
Specifies the DB2 optimization class that is performed by the database when generating a query plan for a SQL statement.
This property is only applicable to connections to DB2 V9.7 and higher for Linux/UNIX/Windows.
Valid Values
-1 | 0 | 1 | 2 | 3 | 5 | 7 | 9
If set to -1, the default class configured for the database server is used.
If set to 0, a minimum amount of optimization is performed. This class is useful for simple dynamic SQL to well-indexed database tables.
If set to 1, optimization that is comparable to DB2 Version 1 for Linux/UNIX/Windows is performed.
If set to 2, more optimization is performed than if set to a value of 1, but significantly less optimization is performed than if set to a value of 3 and higher, particularly for complex queries.
If set to 3, a moderate amount of optimization is performed.
If set to 5, a significant amount of optimization is performed. For complex dynamic SQL statements, heuristic rules are used to limit the amount of time spent selecting a query plan. When possible, Select statements obtain data from a materialized query table.
If set to 7, a significant amount of optimization is performed. For complex dynamic SQL statements, heuristic rules are not used to limit the amount of time spent selecting a query plan. When possible, Select statements obtain data from a materialized query table.
If set to 9, the maximum amount of optimization is performed, which can significantly expand the number of query plans that are evaluated for selection. This value, along with performance metrics, can be used to determine if a better-performing query plan can be generated for complex or long-running SQL statements.
Default
-1
Data Type
int
See also
“Choosing a DB2 Optimization Class”
Database
Description
An alias for the DatabaseName property.
DatabaseName
Description
REQUIRED. The name of the database to which you want to connect. This property is supported only for DB2 for Linux/UNIX/Windows.
Valid Values
string
where string is the name of a DB2 database.
Default
None
Data Type
String
Alias
Database property. If both the Database and DatabaseName properties are specified in a connection URL, the last property that is positioned in the connection URL is used. For example, if your application specifies the following connection URL, the value of the Database connection property would be used instead of the value of the DatabaseName connection property.
jdbc:datadirect:db2://server1:50000;DatabaseName=jdbc;Database=acct;
User=test;Password=secret
NOTE: This property is an alias for LocationName when connecting to DB2 for z/OS or iSeries.
DynamicSections
Description
The maximum number of prepared statements that the driver can have open at any one time.
Valid Values
x
where x is a positive integer that represents a number of prepared statements.
Default
200
Data Type
int
EnableCancelTimeout
Description
Determines whether a cancel request that is sent by the driver as the result of a query timing out is subject to the same query timeout value as the statement it cancels.
Valid Values
true | false
If set to true, the cancel request times out using the same timeout value, in seconds, that is set for the statement it cancels. For example, if your application calls Statement.setQueryTimeout(5) on a statement and that statement is cancelled because its timeout value was exceeded, the driver sends a cancel request that also will time out if its execution exceeds 5 seconds. If the cancel request times out, because the server is down, for example, the driver throws an exception indicating that the cancel request was timed out and the connection is no longer valid.
If set to false, the cancel request does not time out.
Default
false
Data Type
boolean
EncryptionMethod
Description
Determines whether data is encrypted and decrypted when transmitted over the network between the driver and database server.
NOTE: Connection hangs can occur when the driver is configured for SSL and the database server does not support SSL. You may want to set a login timeout using the LoginTimeout property to avoid problems when connecting to a server that does not support SSL.
Valid Values
noEncryption | DBEncryption | requestDBEncryption | SSL
If set to noEncryption, data is not encrypted or decrypted.
If set to DBEncryption, data is encrypted using DES encryption if the database server supports it. If the database server does not support DES encryption, the connection fails and the driver throws an exception. The AuthenticationMethod property must be set to a value of clearText, encryptedPassword, or encryptedUIDPassword. This value is not supported for DB2 for iSeries.
If set to requestDBEncryption, data is encrypted using DES encryption if the database server supports it. If the database server does not support DES encryption, the driver attempts to establish an unencrypted connection. The AuthenticationMethod property must be set to a value of clearText, encryptedPassword, or encryptedUIDPassword. This value is not supported for DB2 for iSeries.
If set to SSL, data is encrypted using SSL. If the database server does not support SSL, the connection fails and the driver throws an exception.
When SSL is enabled, the following properties also apply:
HostNameInCertificate
KeyStore (for SSL client authentication)
KeyStorePassword (for SSL client authentication)
KeyPassword (for SSL client authentication)
TrustStore
TrustStorePassword
ValidateServerCertificate
Default
noEncryption
Data Type
String
See Also
“Configuring SSL Encryption”
“Performance Considerations”
FailoverGranularity
Description
Determines whether the driver fails the entire failover process or continues with the process if exceptions occur while trying to reestablish a lost connection. This property is ignored if FailoverMode=connect.
Valid Values
nonAtomic | atomic | atomicWithRepositioning
If set to nonAtomic, the driver continues with the failover process and posts any exceptions on the statement on which they occur.
If set to atomic, the driver fails the entire failover process if an exception is generated as the result of restoring the state of the connection. If an exception is generated as a result of restoring the state of work in progress, the driver continues with the failover process, but generates an exception warning that the Select statement must be reissued.
If set to atomicWithRepositioning, the driver fails the entire failover process if any exception is generated as the result of restoring the state of the connection or the state of work in progress.
Default
nonAtomic
Data Type
String
See Also
“Configuring Failover”
FailoverMode
Description
Specifies the type of failover method the driver uses.
Valid Values
connect | extended | select
If set to connect, the driver provides failover protection for new connections only.
If set to extended, the driver provides failover protection for new and lost connections, but not any work in progress.
If set to select, the driver provides failover protection for new and lost connections. In addition, it preserves the state of work performed by the last Select statement executed on the Statement object.
NOTES:
■
The AlternateServers property specifies one or multiple alternate servers for failover and is required for all failover methods. To turn off failover, do not specify a value for the AlternateServers property.
■
The FailoverGranularity property determines which action the driver takes if exceptions occur during the failover process.
■
The FailoverPreconnect property specifies whether the driver tries to connect to multiple database servers (primary and alternate) at the same time.
Default
connect
Data Type
String
See Also
“Configuring Failover”
FailoverPreconnect
Description
Specifies whether the driver tries to connect to the primary and an alternate server at the same time. This property is ignored if FailoverMode=connect.
Valid Values
true | false
If set to true, the driver tries to connect to the primary and an alternate server at the same time. This can be useful if your application is time-sensitive and cannot absorb the wait for the failover connection to succeed.
If set to false, the driver tries to connect to an alternate server only when failover is caused by an unsuccessful connection attempt or a lost connection. This value provides the best performance, but your application typically experiences a short wait while the failover connection is attempted.
NOTE: The AlternateServers property specifies one or multiple alternate servers for failover.
Default
false
Data Type
boolean
See Also
“Configuring Failover”
Grantee
Description
The name of the schema to which you want to grant EXECUTE privileges for DB2 packages. This property is ignored if the GrantExecute property is set to false.
Valid Values
string
where string is a valid DB2 schema.
IMPORTANT: Using a value other than PUBLIC restricts access to use the driver. For example, if you set this property to TSMITH, only the user TSMITH would be allowed access to use the driver against the server.
Default
PUBLIC
Data Type
String
See Also
“DB2 Packages”
GrantExecute
Description
Determines which DB2 schema is granted EXECUTE privileges for DB2 packages.
Valid Values
true | false
If set to true, EXECUTE privileges are granted to the schema that is specified by the Grantee property.
If set to false, EXECUTE privileges are granted to the schema that created the DB2 packages.
Default
true
Data Type
boolean
See Also
“DB2 Packages”
HostNameInCertificate
Description
Specifies a host name for certificate validation when SSL encryption is enabled (EncryptionMethod=SSL) and validation is enabled (ValidateServerCertificate=true). This property is optional and provides additional security against man-in-the-middle (MITM) attacks by ensuring that the server the driver is connecting to is the server that was requested.
NOTES:
■
■
If SSL encryption and validation is enabled and this property is unspecified, the driver uses the server name specified in the connection URL or data source of the connection to validate the certificate.
Valid Values
host_name | #SERVERNAME#
where host_name is a valid host name.
If host_name is specified, the driver compares the specified host name to the DNSName value of the SubjectAlternativeName in the certificate. If a DNSName value does not exist in the SubjectAlternativeName or if the certificate does not have a SubjectAlternativeName, the driver compares the host name with the Common Name (CN) part of the certificate’s Subject name. If the values do not match, the connection fails and the driver throws an exception.
If #SERVERNAME# is specified, the driver compares the server name that is specified in the connection URL or data source of the connection to the DNSName value of the SubjectAlternativeName in the certificate. If a DNSName value does not exist in the SubjectAlternativeName or if the certificate does not have a SubjectAlternativeName, the driver compares the host name to the CN part of the certificate’s Subject name. If the values do not match, the connection fails and the driver throws an exception. If multiple CN parts are present, the driver validates the host name against each CN part. If any one validation succeeds, a connection is established.
Default
empty string
Data Type
String
ImportStatementPool
Description
Specifies the path and file name of the file to be used to load the contents of the statement pool. When this property is specified, statements are imported into the statement pool from the specified file.
If the driver cannot locate the specified file when establishing the connection, the connection fails and the driver throws an exception.
Valid Values
string
where string is the path and file name of the file to be used to load the contents of the statement pool.
Default
empty string
Data Type
String
See Also
“Using Statement Pooling”
Chapter 10 “Statement Pool Monitor” in the DataDirect Connect for JDBC Reference
“Performance Considerations”
InitializationString
Description
Specifies one or multiple SQL commands to be executed by the driver after it has established the connection to the database and has performed all initialization for the connection. If the execution of a SQL command fails, the connection attempt also fails and the driver throws an exception indicating which SQL command or commands failed.
Valid Values
command[[;command]...]
where command is a SQL command.
NOTE: Multiple commands must be separated by semicolons. In addition, if this property is specified in a connection URL, the entire value must be enclosed in parentheses when multiple commands are specified.
Example
The following connection URL adds USER2 to the CURRENT PATH special register and sets the CURRENT PRECISION special register to DEC31.
jdbc:datadirect:db2://server1:50000;InitializationString=
(SET CURRENT PATH=current_path, USER2;SET CURRENT PRECISION='DEC31')
NOTE: Setting the CURRENT PRECISION special register is only valid for DB2 for z/OS.
Default
None
Data Type
String
InsensitiveResultSetBufferSize
Description
Determines the amount of memory that is used by the driver to cache insensitive result set data.
Valid Values
-1 | 0 | x
If set to -1, the driver caches insensitive result set data in memory. If the size of the result set exceeds available memory, an OutOfMemoryException is generated. With no need to write result set data to disk, the driver processes the data efficiently.
If set to 0, the driver caches insensitive result set data in memory, up to a maximum of 2 MB. If the size of the result set data exceeds available memory, the driver pages the result set data to disk. Because result set data may be written to disk, the driver may have to reformat the data to write it correctly to disk.
If set to x, where x is a positive integer that represents the size (in KB) of the memory buffer. The driver caches insensitive result set data in memory and uses this value to set the size of the memory buffer for caching insensitive result set data. If the size of the result set data exceeds available memory, the driver pages the result set data to disk. Because the result set data may be written to disk, the driver may have to reformat the data to write it correctly to disk. Specifying a buffer size that is a power of 2 results in efficient memory use.
Default
2048
Data Type
int
See Also
“Performance Considerations”
JavaDoubleToString
Description
Determines which algorithm the driver uses when converting a double or float value to a string value. By default, the driver uses its own internal conversion algorithm, which improves performance.
Valid Values
true | false
If set to true, the driver uses the JVM algorithm when converting a double or float value to a string value. If your application cannot accept rounding differences and you are willing to sacrifice performance, set this value to true to use the JVM conversion algorithm.
If set to false, the driver uses its own internal algorithm when converting a double or float value to a string value. This value improves performance, but slight rounding differences within the allowable error of the double and float data types can occur when compared to the same conversion using the JVM algorithm.
Default
false
Data Type
boolean
JDBCBehavior
Description
Determines how the driver describes database data types that map to the following JDBC 4.0 data types: NCHAR, NVARCHAR, NLONGVARCHAR, NCLOB, and SQLXML.
This property is applicable only when the application is using Java SE 6 or higher.
Valid Values
0 | 1
If set to 0, the driver describes the data types as JDBC 4.0 data types when using Java SE 6 or higher.
If set to 1, the driver describes the data types using JDBC 3.0-equivalent data types, regardless of JVM. This allows your application to continue using JDBC 3.0 types in a Java SE 6 or higher environment. In addition, the JDBC 4.0 method ResultSet.getHoldability() returns the value of the JDBC 3.0 method Connection.getHoldability().
Default
1
Data Type
int
KeyPassword
Description
Specifies the password that is used to access the individual keys in the keystore file when SSL is enabled (EncryptionMethod=SSL) and SSL client authentication is enabled on the database server. This property is useful when individual keys in the keystore file have a different password than the keystore file.
Valid Values
string
where string is a valid password.
Default
None
Data Type
String
KeyStore
Description
Specifies the directory of the keystore file to be used when SSL is enabled (EncryptionMethod=SSL) and SSL client authentication is enabled on the database server. The keystore file contains the certificates that the client sends to the server in response to the server’s certificate request.
This value overrides the directory of the keystore file that is specified by the javax.net.ssl.keyStore Java system property. If this property is not specified, the keystore directory is specified by the javax.net.ssl.keyStore Java system property.
NOTE: The keystore and truststore files can be the same file.
Valid Values
string
where string is a valid directory of a keystore file.
Default
None
Data Type
String
KeyStorePassword
Description
Specifies the password that is used to access the keystore file when SSL is enabled (EncryptionMethod=SSL) and SSL client authentication is enabled on the database server. The keystore file contains the certificates that the client sends to the server in response to the server’s certificate request.
This value overrides the password of the keystore file that is specified by the javax.net.ssl.keyStorePassword Java system property. If this property is not specified, the keystore password is specified by the javax.net.ssl.keyStorePassword Java system property.
NOTE: The keystore and truststore files can be the same file.
Valid Values
string
where string is a valid password.
Default
None
Data Type
String
LoadBalancing
Description
Determines whether the driver uses client load balancing in its attempts to connect to the database servers (primary and alternate). You can specify one or multiple alternate servers by setting the AlternateServers property.
Valid Values
true | false
If set to true, the driver uses client load balancing and attempts to connect to the database servers (primary and alternate) in random order. The driver randomly selects from the list of primary and alternate servers which server to connect to first. If that connection fails, the driver again randomly selects from this list of servers until all servers in the list have been tried or a connection is successfully established.
If set to false, the driver does not use client load balancing and connects to each server based on their sequential order (primary server first, then, alternate servers in the order they are specified).
Default
false
Data Type
boolean
See Also
“Configuring Failover”
LobStreamingProtocol
Description
Determines whether streaming or materialization (client caching) is used when the driver fetches LOB and XML data. In most cases, streaming provides better performance; however, materialization can reduce network round trips to the database server when updating LOB data using Clob and Blob objects, which can improve performance.
Valid Values
streaming | materialize
If set to streaming, the driver determines the most efficient way to return LOB and XML data based on the following conditions:
■
■
For example, if streaming is supported by the database server and an application requests LOB data for a row as a stream, the driver uses streaming to transport the data. If streaming is not supported by the database server or if the application requests the data as a byte array or a String, the driver fully materializes the data on the client.
If set to materialize, the driver fully materializes the data on the client instead of using streaming.
Default
streaming
Data Type
String
See Also
“Performance Considerations”
LocationName
Description
REQUIRED. The name of the DB2 location that you want to access.
For DB2 for z/OS, your system administrator can determine the name of your DB2 location using the following command:
DISPLAY DDF
For DB2 for iSeries, your system administrator can determine the name of your DB2 location using the following command. The name of the database that is listed as *LOCAL is the value you should use for this property.
WRKRDBDIRE
This property is not supported for DB2 for Linux/UNIX/Windows.
Valid Values
string
where string is the DB2 location.
Default
None
Data Type
String
Alias
DatabaseName property. If both the DatabaseName and LocationName connection properties are specified in a connection URL, the last property positioned in the connection URL is used. For example, if your application specifies the following connection URL, the value of the LocationName property would be used instead of the value of the DatabaseName property.
jdbc:datadirect:db2://server1:50000;DatabaseName=jdbc;LocationName=acct;
User=test;Password=secret
LoginTimeout
Description
The amount of time, in seconds, that the driver waits for a connection to be established before timing out the connection request.
Valid Values
0 | x
where x is a positive integer that represents a number of seconds.
If set to 0, the driver does not time out a connection request.
If set to x, the driver waits for the specified number of seconds before returning control to the application and throwing a timeout exception.
Default
0
Data Type
int
LongDataCacheSize
Description
Determines whether the driver caches long data (images, pictures, long text, binary, or XML data) in result sets. To improve performance, you can disable long data caching if your application retrieves columns in the order in which they are defined in the result set.
Valid Values
-1 | 0 | x
where x is a positive integer that represents the size of the memory buffer.
If set to -1, the driver does not cache long data in result sets. It is cached on the server. Use this value only if your application retrieves columns in the order in which they are defined in the result set.
If set to 0, the driver caches long data in result sets in memory. If the size of the result set data exceeds available memory, the driver pages the result set data to disk.
If set to x, the driver caches long data in result sets in memory and uses this value to set the size (in KB) of the memory buffer for caching result set data. If the size of the result set data exceeds available memory, the driver pages the result set data to disk.
Default
2048
Data Type
int
See Also
“Performance Considerations”
MaxPooledStatements
Description
The maximum number of pooled prepared statements for this connection. Setting MaxPooledStatements to an integer greater than zero (0) enables the driver’s internal prepared statement pooling, which is useful when the driver is not running from within an application server or another application that provides its own prepared statement pooling.
Valid Values
0 | x
where x is a positive integer that represents a number of prepared statements to be cached.
If set to 0, the driver’s internal prepared statement pooling is not enabled.
If set to x, the driver enables the DataDirect Statement Pool Monitor and uses the specified value to cache a certain number of prepared statements created by an application. If the value set for this property is greater than the number of prepared statements that are used by the application, all prepared statements that are created by the application are cached. Because CallableStatement is a sub-class of PreparedStatement, CallableStatements also are cached.
Example
If the value of this property is set to 20, the driver caches the last 20 prepared statements that are created by the application.
Default
0
Data Type
int
Alias
MaxStatements property
See Also
“Using Statement Pooling”
Chapter 10 “Statement Pool Monitor” in the DataDirect Connect Series for JDBC Reference
“Performance Considerations”
MaxStatements
Description
An alias for the MaxPooledStatements property.
OptimizationProfile
Description
The DB2 optimization profile that is used during SQL optimization. The optimization profile contains optimization guidelines that are passed to DB2 to influence the generation of query plans. This property sets the value of the DB2 OPTIMIZATION PROFILE special register.
This property only applies to DB2 V9.1 and higher for Linux/UNIX/Windows.
Valid Values
profile_name
where profile_name is the name of a valid DB2 optimization profile.
Default
null
Data Type
String
See Also
“Performance Considerations”
OptimizationProfileToFlush
Description
The DB2 optimization profile to be removed from the optimization profile cache. An optimization profile is processed the first time it is used to optimize a SQL statement, and the output is stored in the optimization profile cache. If the profile is modified after it is processed, its output should be removed from the optimization profile cache.
This property is only applicable to connections to DB2 V9.1 and higher for Linux/UNIX/Windows.
NOTE: The user specifying this property must have administrator privileges to remove optimization profiles from the optimization profile cache. Consult with your system administrator.
Valid Values
profile_name | all
where profile_name is the name of a valid DB2 optimization profile.
If set to profile_name, the driver removes the specified profile from the optimization profile cache.
If set to all, the driver removes all profiles from the optimization profile cache.
Default
null
Data Type
String
See Also
“Performance Considerations”
PackageCollection
Description
The name of the collection or library (group of packages) to which DB2 packages are bound.
NOTES:
■
■
This property replaces the CollectionId property, which has been deprecated; however, the CollectionId property is still recognized for backward compatibility. If both the PackageCollection and CollectionId properties are specified, the CollectionId property is ignored.
Default
NULLID
Data Type
String
See Also
“DB2 Packages”
PackageOwner
Description
The owner to be used for any DB2 packages that are created.
Valid Values
string
where string is the owner of the DB2 packages.
Default
NULL
Data Type
String
See Also
“DB2 Packages”
Password
Description
A password that is used to connect to your DB2 database. A password is required if security is enabled on your database. Contact your system administrator to obtain your password.
Valid Values
string
where string is a valid password. The password is case-sensitive.
Default
None
Data Type
String
PortNumber
Description
The TCP port of the primary database server that is listening for connections to the DB2 database.
This property is supported only for data source connections.
Valid Values
port
where port is the port number.
Default
50000
Data Type
int
ProgramID
Description
The driver and version information on the client to be stored in the database. This property sets the CLIENT_PRDID value in the database. For DB2 V9.1 and higher for Linux/UNIX/Windows, this value is located in the SYSIBMADM.APPLICATIONS table.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
DDJVVRRM
where:
■
DDJ identifies the driver as a DataDirect Connect Series for JDBC driver.
■
VV identifies a 2-digit version number (with high-order 0 in the case of a 1-digit version).
■
RR identifies a 2-digit release number (with high-order 0 in the case of a 1-digit release).
■
M identifies a 1-character modification level (0-9 or A-Z).
Example
DDJ04200
Default
empty string
Data Type
String
See Also
“Using Client Information”
QueryTimeout
Description
Sets the default query timeout (in seconds) for all statements created by a connection.
Valid Values
-1 | 0 | x
where x is a number of seconds.
If set to -1, the query timeout functionality is disabled. The driver silently ignores calls to the Statement.setQueryTimeout() method.
If set to 0, the default query timeout is infinite (the query does not time out).
If set to x, the driver uses the value as the default timeout for any statement created by the connection. To override the default timeout value that is set by this property, call the Statement.setQueryTimeout() method to set a timeout value for a particular statement.
Default
0
Data Type
int
ReplacePackage
Description
Determines whether the current bind process will replace the existing DB2 packages used by the driver.
For DB2 for Linux/UNIX/Windows, this property must be used in conjunction with the CreateDefaultPackage property.
Valid Values
true | false
If set to true, the current bind process will replace the existing DB2 packages that are used by the driver.
If set to false, the current bind process will not replace the existing DB2 packages.
Default
false
Data Type
boolean
See Also
“DB2 Packages”
ResultSetMetaDataOptions
Description
Determines whether the driver returns table name information in the ResultSet metadata for Select statements.
Valid Values
0 | 1
If set to 0 and the ResultSetMetaData.getTableName() method is called, the driver does not perform additional processing to determine the correct table name for each column in the result set. The getTableName() method may return an empty string for each column in the result set.
If set to 1 and the ResultSetMetaData.getTableName() method is called, the driver performs additional processing to determine the correct table name for each column in the result set. The driver returns schema name and catalog name information when the ResultSetMetaData.getSchemaName() and ResultSetMetaData.getCatalogName() methods are called if the driver can determine that information.
Default
0
Data Type
int
See Also
“Performance Considerations”
SendStreamAsBlob
Description
Determines whether binary stream data that is less than 32 KB is sent to the database as DB2 Long Varchar for Bit Data or Blob data. Binary streams that are larger than 32 KB can only be inserted into a Blob column. The driver always sends binary stream data larger than 32 KB to the database as Blob data.
Valid Values
true | false
If set to true, the driver sends binary stream data that is less than 32 KB to the database as DB2 Blob data. If the target column is a Long Varchar for Bit Data column and not a Blob column, the Insert or Update statement fails. The driver automatically retries the Insert or Update statement, sending the data as Long Varchar for Bit Data, if the pointer in the stream can be reset to the beginning of the stream. If you know that you are sending the binary stream data to a Blob column, setting this value improves performance.
If set to false, the driver sends binary stream data that is less than 32 KB to the database as Long Varchar for Bit Data data. If the target column is a Blob column and not a Long Varchar for Bit Data column, the Insert or Update statement fails. The driver retries the Insert or Update statement, sending the data as Blob data, if the pointer in the stream can be reset to the beginning of the stream.
Default
false
Data Type
boolean
See Also
“Performance Considerations”
ServerName
Description
REQUIRED. Specifies either the IP address in IPv4 or IPv6 format, or the server name (if your network supports named servers) of the primary database server.
This property is supported only for data source connections.
Valid Values
string
where string is a valid IP address or server name.
Example
122.23.15.12 or DB2Server
Default
None
Data Type
String
SpyAttributes
Description
Enables DataDirect Spy to log detailed information about calls that are issued by the driver on behalf of the application. DataDirect Spy is not enabled by default.
Valid Values
(spy_attribute[;spy_attribute]...)
where spy_attribute is any valid DataDirect Spy attribute. Refer to Chapter 8 “Tracking JDBC Calls with DataDirect Spy™” in the DataDirect Connect Series for JDBC Reference for a list of supported attributes.
NOTE: If coding a path on Windows to the log file in a Java string, the backslash character (\) must be preceded by the Java escape character, a backslash. For example:
log=(file)C:\\temp\\spy.log.
Example
The following value instructs the driver to log all JDBC activity to a file using a maximum of 80 characters for each line.
(log=(file)/tmp/spy.log;linelimit=80)
Default
None
Data Type
String
StripNewlines
Description
Specifies whether newline characters in a SQL statement are sent to the DB2 server. If you know that SQL statements in your application do not contain newline characters, the driver can skip the removal of newline characters, improving performance by eliminating the parsing required by the DB2 server to remove them.
Valid Values
true | false
If set to true, the driver removes all newline characters from SQL statements.
If set to false, the driver does not remove any newline characters from SQL statements.
Default
false
Data Type
boolean
See Also
“Performance Considerations”
TrustStore
Description
Specifies the directory of the truststore file to be used when SSL is enabled using the EncryptionMethod property and server authentication is used. The truststore file contains a list of the Certificate Authorities (CAs) that the client trusts.
This value overrides the directory of the truststore file that is specified by the javax.net.ssl.trustStore Java system property. If this property is not specified, the truststore directory is specified by the javax.net.ssl.trustStore Java system property.
This property is ignored if ValidateServerCertificate=false.
Valid Values
string
where string is the directory of the truststore file.
Default
None
Data Type
String
TrustStorePassword
Description
Specifies the password that is used to access the truststore file when SSL is enabled using the EncryptionMethod property and server authentication is used. The truststore file contains a list of the Certificate Authorities (CAs) that the client trusts.
This value overrides the password of the truststore file that is specified by the javax.net.ssl.trustStorePassword Java system property. If this property is not specified, the truststore password is specified by the javax.net.ssl.trustStorePassword Java system property.
This property is ignored if ValidateServerCertificate=false.
Valid Values
string
where string is a valid password for the truststore file.
Default
None
Data Type
String
UseCurrentSchema
Description
Specifies whether results are restricted to the tables and views in the current schema if a DatabaseMetaData.getTables() or DatabaseMetaData.getColumns() method is called without specifying a schema or if the schema is specified as the wildcard character %. Restricting results to the tables and views in the current schema improves the performance of calls for getTables() methods that do not specify a schema.
Valid Values
true | false
If set to true, results that are returned from the getTables() and getColumns() methods are restricted to tables and views in the current schema.
If set to false, results of the getTables() and getColumns() methods are not restricted.
Default
false
Data Type
boolean
See Also
“Performance Considerations”
User
Description
The user name that is used to connect to the DB2 database.
Valid Values
string
where string is a valid user name. The user name is case-sensitive.
Default
None
Data Type
String
ValidateServerCertificate
Description
Determines whether the driver validates the certificate that is sent by the database server when SSL encryption is enabled (EncryptionMethod=SSL). When using SSL server authentication, any certificate that is sent by the server must be issued by a trusted Certificate Authority (CA). Allowing the driver to trust any certificate that is returned from the server even if the issuer is not a trusted CA is useful in test environments because it eliminates the need to specify truststore information on each client in the test environment.
Valid Values
true | false
If set to true, the driver validates the certificate that is sent by the database server. Any certificate from the server must be issued by a trusted CA in the truststore file. If the HostNameInCertificate property is specified, the driver also validates the certificate using a host name. The HostNameInCertificate property is optional and provides additional security against man-in-the-middle (MITM) attacks by ensuring that the server the driver is connecting to is the server that was requested.
If set to false, the driver does not validate the certificate that is sent by the database server. The driver ignores any truststore information that is specified by the TrustStore and TrustStorePassword properties or Java system properties.
NOTE: Truststore information is specified using the TrustStore and TrustStorePassword properties or by using Java system properties.
Default
true
Data Type
boolean
WithHoldCursors
Description
Determines whether the cursor stays open on commit. After a commit, DB2 an leave all cursors open (Preserve cursors) or close all open cursors (Delete cursors). Rolling back a transaction closes all cursors regardless of how this property is specified.
Valid Values
true | false
If set to true, the cursor behavior is Preserve.
If set to false, the cursor behavior is Delete.
Default
true
Data Type
boolean
XMLDescribeType
Description
Determines whether the driver maps XML data to the CLOB or BLOB data type.
Valid Values
clob | blob
If set to clob, the driver maps XML data to the CLOB data type.
If set to blob, the driver maps XML data to the BLOB data type.
Default
None
Data Type
String
See Also
“Returning and Inserting/Updating XML Data”