Connection Properties
Table 3-1 lists the JDBC connection properties supported by the DB2 driver and describes each property. The properties have the form:
You can use these connection properties with either the JDBC Driver Manager or DataDirect Connect for JDBC data sources unless otherwise noted.
NOTES:
Table 3-1. DB2 Connection Properties Property DescriptionAddToCreateTable
Default: No default
Data type: String
A string that is appended to the end of all CREATE statements. This property typically is used to add an "in database" clause.
AccountingInfo
Default: empty string
Data type: String
Accounting information to be stored in the database. This value 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. See "Client Information for Connections" for more information about setting client information.
NOTE: Your database may impose character length restrictions on the values set by this property. If the value of this property exceeds any character length restriction, the driver truncates the value. See "Returning MetaData About Client Information Locations".
AllowImplicitResultSetCloseForXA
Default: true
Data type: boolean
{true | false}. Specifies whether result sets in distributed transactions are automatically closed when all rows of the result sets have been returned.
If set to true (the default), 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.
AlternateID
Default: No default
Data type: String
The name of the default schema that is used to qualify unqualified database objects in dynamically prepared SQL statements. Valid values depend on your DB2 database.
For DB2 for Linux/UNIX/Windows and DB2 for iSeries, this property sets the value in the DB2 CURRENT SCHEMA special register. The value of this property must be a valid DB2 schema name. DB2 for Linux/UNIX/Windows and DB2 for iSeries do not validate values specified for the CURRENT SCHEMA register.
For DB2 for z/OS, this property sets the value in the DB2 CURRENT SQLID special register. The value of this property is validated by the server. Refer to your IBM documentation for valid values for the CURRENT SQLID register.
AlternateServers
Default: No default
Data type: String
A list of alternate database servers used to failover new or lost connections, depending on the failover method selected. See the FailoverMode property for information about choosing a failover method.
The value of this property is a string that specifies each alternate server. This string has the format:
(servername1[:port1][;property=value[;...]][,servername2[:port2][;property=value[;...]]]...)The server name is required for each alternate server entry. Port number 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 for the driver are DatabaseName (DB2 for Linux/UNIX/Windows) and LocationName (DB2 for z/OS and DB2 for iSeries). For 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)NOTE: If using failover with DB2 High Availability Disaster Recovery (HADR), the primary server must be the primary server configured in your HADR system and any alternate server must be a standby server configured in your HADR system.
See "Configuring Failover" for more information about specifying connection information for primary and alternate servers.
ApplicationName
Default: empty string
Data type: String
The name of the application to be stored in the database. This value 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, this value also sets the APPL_NAME value of the SYSIBMADM.APPLICATIONS table. These values are used for database administration/monitoring purposes. See "Client Information for Connections" for more information about setting client information.
NOTE: Your database may impose character length restrictions on the values set by this property. If the value of this property exceeds any character length restriction, the driver truncates the value. See "Returning MetaData About Client Information Locations".
AuthenticationMethod
Default: clearText
Data type: String
{kerberos | encryptedUIDPassword | encryptedPassword | clearText | client}. Determines which authentication method the driver uses when establishing a connection.
If set to kerberos, the driver uses Kerberos authentication. The driver ignores any user ID or password specified.
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 a user ID and password are not specified, the driver throws an exception. If this value is set, the driver can also use data encryption (see the EncryptionMethod property for details).
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 a user ID and password are not specified, the driver throws an exception. If this value is set, the driver can also use data encryption (see the EncryptionMethod property for details).
If set to clearText (the default), 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 this value is set, the driver can also use data encryption (see the EncryptionMethod property for details).
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.
The User property provides the user ID. The Password property provides the password.
AuthenticationMethod (cont.)
If the specified authentication method is not supported by the DB2 server, the connection fails and the driver throws an exception.
See "Authentication" for more information about using authentication with the DB2 driver.
BatchPerformanceWorkaround
Default: false
Data type: boolean
{true | false}. The DB2 driver uses the native DB2 batch mechanism. This property determines whether certain restrictions are enforced to facilitate data conversions.
If set to true, restrictions are removed; however, parameter sets may not be executed in the order they were specified.
If set to false (the default), the methods used to set the parameter values of a batch operation 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.
See "Batch Inserts and Updates" for more information.
CatalogIncludesSynonyms
Default: true
Data type: boolean
{true | false}. Determines whether synonyms are included in the result sets returned from the DatabaseMetaData.getColumns() method.
If set to true (the default), synonyms are included in the result sets returned from the DatabaseMetaData.getColumns() method.
If set to false, synonyms are omitted from result sets returned from the DatabaseMetaData.getColumns() method.
This property is ignored for DB2 v8.x and higher for Linux/UNIX/Windows. By default, the driver returns synonyms for the DatabaseMetaData.getColumns() method when connected to DB2 v8.x and higher for Linux/UNIX/Windows.
See "Performance Considerations" for information about configuring this property for optimal performance.
CatalogOptions
Default: 2
Data type: int
{0 | 2 | 6}. Determines which type of metadata information is included in result sets when an application calls DatabaseMetaData methods.
If set to 0, result sets do not contain synonyms.
If set to 2 (the default), result sets contain synonyms 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. Using emulation can improve performance because the SQL statement formulated by the emulation is less complex than the SQL statement 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.
See "Performance Considerations" for information about configuring this property for optimal performance.
CatalogSchema
Default:
SYSCAT (DB2 for
Linux/UNIX/Windows),
SYSIBM (DB2 for z/OS), or
QSYS2 (DB2 for iSeries)Data type: String
The DB2 schema to use for catalog methods. The value must be the name of a valid DB2 schema. The default depends on the platform of the DB2 database.
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.
See "Performance Considerations" for information about configuring this property for optimal performance.
CharsetFor65535
Default: No default
Data type: String
The code page to be used by the driver to convert character data 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 stored as bit data returned from the database using columns defined with CCSID 65535 is converted using the specified code page. The value must be a string containing the name of a valid code page supported by your JVM, for example, CharsetFor65535=CP950. This property has no effect when writing data to character columns defined with CCSID 65535.
ClientHostName
Default: empty string
Data type: String
The host name of the client machine to be stored in the database. This value 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. See "Client Information for Connections" for more information about setting client information.
NOTE: Your database may impose character length restrictions on the values set by this property. If the value of this property exceeds any character length restriction, the driver truncates the value. See "Returning MetaData About Client Information Locations".
ClientUser
Default: empty string
Data type: String
The user ID to be stored in the database. This value sets the CURRENT CLIENT_USERID register (DB2 for Linux/UNIX/Windows) or CLIENT USERID register (DB2 for z/OS and DB2 for iSeries) in the database. This value is used for database administration/monitoring purposes. See "Client Information for Connections" for more information about setting client information.
NOTE: Your database may impose character length restrictions on the values set by this property. If the value of this property exceeds any character length restriction, the driver truncates the value. See "Returning MetaData About Client Information Locations".
CodePageOverride
Default: No default
Data type: String
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 returned from or written to the database is converted using the specified code page. The value must be a string containing the name of a valid code page supported by your JVM, for example, CodePageOverride=CP950.
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.
CollectionId
DEPRECATED
This property is recognized for backward compatibility, but we recommend that you use the PackageCollection property instead to specify the name of the collection or library (group of packages) to which DB2 packages are bound.
See "DB2 Packages" for more information about creating DB2 packages.
ConnectionRetryCount
Default: 5
Data type: int
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. Valid values are 0 and any positive integer.
If set to 0, the driver does not try to reconnect after the initial unsuccessful attempt.
For example, in the case where the following properties are specified:
AlternateServers=(server2:50000,server3:50000,
server4:50000)and
ConnectionRetryCount=1If a connection is not successfully established on the driver’s first pass through the list of database servers, the driver retries all the servers in the list only once.
If an application sets a login timeout value (for example, using DataSource.loginTimeout or DriverManager.loginTimeout), the login timeout takes precedence over this property. For example, if the login timeout expires, the driver ceases connection attempts.
The ConnectionRetryDelay property specifies the wait interval, in seconds, to occur between retry attempts.
See "Configuring Failover" for more information about specifying connection information for primary and alternate servers.
ConnectionRetryDelay
Default: 1
Data type: int
The number of seconds the driver waits between connection retry attempts when ConnectionRetryCount is set to a positive integer.
For example, in the case where the following properties are specified:
AlternateServers=(server2:50000,server3:50000,
server4:50000)and
ConnectionRetryCount=2and
ConnectionRetryDelay=3If a connection is not successfully established on the driver’s first pass through the list of database servers, the driver retries the list of servers twice. It waits 3 seconds between the first connection retry attempt and the second connection retry attempt.
See "Configuring Failover" for more information about specifying connection information for primary and alternate servers.
ConvertNull
Default: 1
Data type: int
{1 | 0}. Controls how data conversions are handled for null values.
If set to 1 (the default), the driver checks the data type being requested against the data type of the table column storing 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.
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.
CreateDefaultPackage
Default: false
Data type: boolean
{true | false}. Determines whether the driver automatically creates required DB2 packages.
If set to true, the DB2 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 default), the driver determines if the required DB2 packages exist. If they do not, the driver automatically creates them.
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 specified by the PackageCollection property.
See "DB2 Packages" for more information about creating DB2 packages.
CurrentFunctionPath
Default: null
Data type: String
A comma-separated list of DB2 schema names used to resolve unqualified function names and data type references in dynamically prepared SQL statements. This value also is used to resolve unqualified stored procedure names specified in CALL statements. This property sets the CURRENT PATH register in the database.
Database
Default: No default
Data type: String
An alias for the DatabaseName property.
DatabaseName
REQUIRED
Default: No default
Data type: String
The name of the database to which you want to connect. This property is supported only for DB2 for Linux/UNIX/Windows.
NOTE: Database is an alias for this property. If both the Database and DatabaseName 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 Database connection property would be used instead of the value of the DatabaseName connection property.
This property is an alias for LocationName when connecting to DB2 for z/OS or iSeries to specify the name of the DB2 location.
DynamicSections
Default: 200
Data type: int
The maximum number of prepared statements that the DB2 driver can have open at any time. The value must be a positive integer.
EnableCancelTimeout
Default: false
Data type: boolean
{true | false}. Determines whether a cancel request 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.
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 default), the cancel request does not time out.
EncryptionMethod
Default: noEncryption
Data type: String
{noEncryption | DBEncryption | requestDBEncryption | SSL}. Determines whether data is encrypted and decrypted when transmitted over the network between the driver and database server.
If set to noEncryption (the default), 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. This value is not supported for DB2 for iSeries. The AuthenticationMethod property must be set to a value of clearText, encryptedPassword, or encryptedUIDPassword.
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. This value is not supported for DB2 for iSeries. The AuthenticationMethod property must be set to a value of clearText, encryptedPassword, or encryptedUIDPassword.
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
ValidateServerCertificateNOTE: 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.
EncryptionMethod (cont.)
See "Configuring SSL Encryption" for more information about configuring data encryption.
See "Performance Considerations" for information about configuring this property for optimal performance.
FailoverGranularity
Default: nonAtomic
Data type: String
{nonAtomic | atomic | atomicWithRepositioning}. 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.
If set to nonAtomic (the default), 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 your application 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.
See "Configuring Failover" for more information about configuring failover.
FailoverMode
Default: connect
Data type: String
{connect | extended | select}. Specifies the type of failover method that will be used.
If set to connect (the default), 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.
The AlternateServers property specifies one or multiple alternate servers for failover and is required for all failover methods.
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 servers) at the same time.
See "Configuring Failover" for more information about configuring failover.
FailoverPreconnect
Default: false
Data type: boolean
{true | false}. 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.
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 default), 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.
The AlternateServers property specifies one or multiple alternate servers for failover.
See "Configuring Failover" for more information about configuring failover.
Grantee
Default: PUBLIC
Data type: String
The name of the schema to which you want to grant EXECUTE privileges for DB2 packages. The value must be a valid DB2 schema. This property is ignored if the GrantExecute property is set to false.
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.
See "DB2 Packages" for more information about creating DB2 packages.
GrantExecute
Default: true
Data type: boolean
{true | false}. Determines which DB2 schema is granted EXECUTE privileges for DB2 packages.
If set to true (the default), EXECUTE privileges are granted to the schema specified by the Grantee property.
If set to false, EXECUTE privileges are granted to the schema that created the DB2 packages.
See "DB2 Packages" for more information about creating DB2 packages.
HostNameInCertificate
Default: empty string
Data type: String
{host_name | #SERVERNAME#}. 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.
If a 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 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 parts of the certificate’s Subject name. If the values do not match, the connection fails and the driver throws an exception.
NOTE: 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.
If unspecified, the driver uses the server name specified in the connection URL or data source of the connection to validate the certificate.
If SSL encryption or certificate validation is not enabled, this property is ignored.
ImportStatementPool
Default: empty string
Data type: String
Specifies the path and file name 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 imported statements cause the number of statements in the pool to exceed the maximum number of statements, the driver closes and discards some statements until the pool size is equal to the maximum pool size. For example, if the maximum number of statements allowed for a statement pool is 10 and the number of statements to be imported is 20, only the last 10 imported statements are placed in the statement pool. The other statements are created, closed, and discarded. Importing more than the maximum number of statements allowed in the statement pool can negatively affect performance because the driver unnecessarily creates some statements that are never placed in the pool.
If the driver cannot locate the specified file when establishing the connection, the connection fails and the driver throws an exception.
See "Importing Statements into a Statement Pool" for more information.
See "Performance Considerations" for information about configuring this property for optimal performance.
InitializationString
Default: None
Data type: String
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.
For example, suppose USER1 needs to invoke stored procedures owned by USER2 without specifying the qualified name for those procedures. You can use this property to add USER2 to the CURRENT PATH special register, which sets the default schema, or schemas, to use when executing a user-defined function or stored procedure.
jdbc:datadirect:db2://server1:50000;
InitializationString=SET CURRENT PATH=current_path, USER2Multiple 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. 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.
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.
InsensitiveResultSetBufferSize
Default: 2048
Data type: int
{-1 | 0 | x}. Determines the amount of memory used by the driver to cache insensitive result set data.
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 GB. 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, the driver caches insensitive result set data in memory and uses this value to set the size (in KB) 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.
See "Performance Considerations" for information about configuring this property for optimal performance.
JavaDoubleToString
Default: false
Data type: boolean
{true | false}. Determines whether the driver uses its internal conversion algorithm or the JVM conversion algorithm when converting double or float values to string values.
If set to true, the driver uses the JVM algorithm when converting double or float values to string values.
If set to false (the default), the driver uses its internal algorithm when converting double or float values to string values. Using this value improves performance; however, slight rounding differences can occur when compared to the same conversion using the JVM algorithm. These differences are within the allowable error of the double and float data types.
JDBCBehavior
Default: 1
Data type: int
{0 | 1}. 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.
If set to 0, the driver describes the data types as JDBC 4.0 data types when using Java SE 6.
If set to 1 (the default), 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 environment. In addition, the JDBC 4.0 method ResultSet.getHoldability() returns the value of the JDBC 3.0 method Connection.getHoldability().
KeyPassword
Default: No default
Data type: String
Specifies the password used to access the individual keys in the keystore file when SSL is enabled using the EncryptionMethod property and SSL client authentication is enabled on the database server. This property is useful if any of the keys in the keystore file have a different password than the keystore file.
KeyStore
Default: No default
Data type: String
Specifies the directory of the keystore file to be used when SSL is enabled using the EncryptionMethod property 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 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.
KeyStorePassword
Default: No default
Data type: String
Specifies the password used to access the keystore file when SSL is enabled using the EncryptionMethod property 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 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.
LoadBalancing
Default: false
Data type: boolean
{true | false}. 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.
If set to true, the driver uses client load balancing and attempts to connect to the database servers (primary and alternate servers) in random order.
If set to false (the default), 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).
Consider the following example:
AlternateServers=(server2:50000,server3:50000,
server4:50000)and
LoadBalancing=trueThe 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.
See "Configuring Failover" for more information about specifying connection information for primary and alternate servers.
LocationName
REQUIRED
Default: No default
Data type: String
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 DDFFor 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.
WRKRDBDIREThis property is supported only for DB2 for z/OS and DB2 for iSeries.
NOTE: DatabaseName is an alias for this 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 connection property would be used instead of the value of the DatabaseName connection property.
LoginTimeout
Default: 0
Data type: int
The amount of time, in seconds, that the driver waits for a connection to be established before returning control to the application and throwing a timeout exception.
If set to 0 (the default), the driver does not time out a connection request.
MaxPooledStatements
Default: 0
Data type: int
The maximum number of pooled prepared statements for this connection. Setting MaxPooledStatements to an integer greater than zero (0) enables the DB2 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.
If set to 0 (the default), the driver’s internal prepared statement pooling is not enabled.
If set to a positive integer, the driver uses that value to cache a certain number of prepared statements created by an application. For example, if the value of this property is set to 20, the driver caches the last 20 prepared statements created by the application. If the value set for this property is greater than the number of prepared statements used by the application, all prepared statements created by the application are cached. Because CallableStatement is a sub-class of PreparedStatement, CallableStatements also are cached.
Before applications can use the DataDirect Statement Pool Monitor, this connection property must be set to a positive integer. See "Statement Pool Monitor" for details on using the Statement Pool Monitor.
MaxStatements is an alias for this property.
See "Performance Considerations" for information about configuring this property for optimal performance.
MaxStatements
Default: 0
Data type: int
An alias for the MaxPooledStatements property. See MaxPooledStatements for a description.
PackageCollection
Default: NULLID
Data type: String
The name of the collection or library (group of packages) to which DB2 packages are bound.
This property is ignored for DB2 for Linux/UNIX/Windows.
NOTE: This property replaces the CollectionId property; however, the CollectionId property is still recognized for backward compatibility. If both the PackageCollection and CollectionId properties are specified, the CollectionId property is ignored.
See "DB2 Packages" for more information about creating DB2 packages.
PackageOwner
Default: NULL
Data type: String
The owner to be used for any DB2 packages that are created.
See "DB2 Packages" for more information about creating DB2 packages.
Password
Default: No default
Data type: String
A case-sensitive password used to connect to your DB2 database. A password is required only if security is enabled on your database. Contact your system administrator to obtain your password.
PortNumber
Default: 50000
Data type: int
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.
ProgramID
Default: empty string
Data type: String
The product and version information of the driver on the client to be stored in the database. This value 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. The format of the value is DDJVVRRM, where:
For example, DDJ04000.
See "Client Information for Connections" for more information about setting client information.
QueryTimeout
Default: 0
Data type: int
{positive integer | -1 | 0}. Sets the default query timeout (in seconds) for all statements created by a connection.
If set to a positive integer, the driver uses the value as the default timeout for any statement created by the connection. To override the default timeout value set by this connection option, call the Statement.setQueryTimeout() method to set a timeout value for a particular statement.
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), the default query timeout is infinite (the query does not time out).
ReplacePackage
Default: false
Data type: boolean
{true | false}. Determines whether the current bind process will replace the existing DB2 packages used by the driver.
If set to true, the current bind process will replace the existing DB2 packages used by the driver.
If set to false (the default), the current bind process will not replace the existing DB2 packages.
For DB2 for Linux/UNIX/Windows, this property must be used in conjunction with the CreateDefaultPackage property.
See "DB2 Packages" for more information about creating DB2 packages.
ResultSetMetaDataOptions
Default: 0
Data type: int
{0 | 1}. The DB2 driver can return table name information in the ResultSet metadata for Select statements if your application requires that information.
If set to 0 (the default) and the ResultSetMetaData.getTableName() method is called, the DB2 driver does not perform additional processing to determine the correct table name for each column in the result set. In this case, 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 DB2 driver performs additional processing to determine the correct table name for each column in the result set. The DB2 driver also can return schema name and catalog name information when the ResultSetMetaData.getSchemaName() and ResultSetMetaData.getCatalogName() methods are called if the driver can determine that information.
See "Performance Considerations" for information about configuring this property for optimal performance.
SecurityMechanism
DEPRECATED
This property is recognized for backward compatibility, but we recommend that you use the AuthenticationMethod property to set the authentication method used by the driver.
SendStreamAsBlob
Default: false
Data type: boolean
{true | false}. 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.
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 default), 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.
See "Performance Considerations" for information about configuring this property for optimal performance.
ServerName
REQUIRED
Default: No default
Data type: String
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. For example, 122.23.15.12 or DB2Server.
This property is supported only for data source connections.
SpyAttributes
Default: No default
Data type: String
Enables DataDirect Spy to log detailed information about calls issued by the driver on behalf of the application. The format for the value of this property is:
(spy_attribute[;spy_attribute]...)where
spy_attributeis any valid DataDirect Spy attribute. See "Tracking JDBC Calls with DataDirect Spy™" for a list of supported attributes.For example:
SpyAttributes=(log=(file)/tmp/spy.log;linelimit=80)logs all JDBC activity to a file using a maximum of 80 characters for each line.
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.DataDirect Spy is not enabled by default.
StripNewlines
Default: false
Data type: boolean
{true | false}. Specifies whether newline characters in a SQL statement are sent to the DB2 server. If you know that the SQL statements used in your application do not contain newline characters, instructing the driver to not remove them eliminates parsing by the DB2 server and improves performance.
If set to true, the driver removes all newline characters from SQL statements.
If set to false (the default), the driver does not remove any newline characters from SQL statements.
See "Performance Considerations" for information about configuring this property for optimal performance.
TrustStore
Default: No default
Data type: String
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 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.
TrustStorePassword
Default: No default
Data type: String
Specifies the password 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 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.
UseCurrentSchema
Default: false
Data type: boolean
{true | false}. 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.
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 (the default), results of the getTables() and getColumns() methods are not restricted.
See "Performance Considerations" for information about configuring this property for optimal performance.
User
Default: No default
Data type: String
The case-sensitive user name used to connect to the DB2 database.
ValidateServerCertificate
Default: true
Data type: boolean
{true | false}. Determines whether the driver validates the certificate sent by the database server when SSL encryption is enabled (EncryptionMethod=SSL). When using SSL server authentication, any certificate sent by the server must be issued by a trusted Certificate Authority (CA). Allowing the driver to trust any certificate 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.
If set to true (the default), the driver validates the certificate 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 sent by the database server. The driver ignores any truststore information specified by the TrustStore and TrustStorePassword properties or Java system properties.
Truststore information is specified using the TrustStore and TrustStorePassword properties or by using Java system properties.
WithHoldCursors
Default: true
Data type: boolean
{true | false}. Determines whether the cursor stays open on commit—either DB2 leaves all cursors open (Preserve cursors) or closes all open cursors (Delete cursors) after a commit. Rolling back a transaction closes all cursors regardless of how this property is specified.
If set to true (the default), the cursor behavior is Preserve.
If set to false, the cursor behavior is Delete.
XMLDescribeType
Default: No default
Data type: String
{clob | blob}. Determines whether the driver maps XML data to the CLOB or BLOB data type.
If set to clob (the default), the driver maps XML data to the CLOB data type.
If set to blob, the driver maps XML data to the BLOB data type.
See "Returning and Inserting/Updating XML Data" for more information.