You can use connection properties to customize the driver for your environment. This section organizes connection properties according to functionality. You can use connection properties with either the JDBC DriverManager or a JDBC data source. For a DriverManager connection, a property is expressed as a key value pair and takes the form property=value. For a data source connection, a property is expressed as a JDBC method and takes the form setproperty(value).

Note:
  • In a JDBC data source, string values must be enclosed in double quotation marks, for example, setUser("abc@defcorp.com").
  • The data type listed for each connection property is the Java data type used for the property value in a JDBC data source.
  • Connection property names are case-insensitive. For example, Password is the same as password.
  • For connection properties that support string values, use the following escape sequence to specify values containing leading or trailing spaces and curly brackets: {value}. For example: User={hello } or Password={{hello}}.

The following tables describe the connection properties by functionality.

General properties

The following table summarizes connection properties required to connect to a database.

Property Data Source Method Default
Database setDatabase(String)

getDatabase()

No default value
LocationName setLocationName(String)

getLocationName()

No default value
PortNumber setPortNumber(Int)

getPortNumber()

50000
ServerName setServerName(String)

getServerName()

No default value

User ID and password authentication properties

The following table summarizes the connection properties required for user ID and password authentication.

Property Data Source Method Default
AuthenticationMethod setAuthenticationMethod(String)

getAuthenticationMethod()

clearText
Password setPassword(String)

getPassword()

No default value
User setUser(String)

getUser()

No default value

User ID and password authentication with AES encryption properties

The following table summarizes the connection properties required for user ID and password authentication using AES encryption with random number generator for secure seeding.

Property Data Source Method Default
AuthenticationMethod setAuthenticationMethod(String)

getAuthenticationMethod()

clearText
RandomGenerator setRandomGenerator(String)

getRandomGenerator()

secureRandom
SecureRandomAlgorithm setSecureRandomAlgorithm(String)

getSecureRandomAlgorithm()

No default value
Password setPassword(String)

getPassword()

No default value
User setUser(String)

getUser()

No default value

GSS plug-in authentication properties

The following table summarizes the connection properties required for GSS plug-in authentication.

Property Data Source Method Default
AuthenticationMethod setAuthenticationMethod(String)

getAuthenticationMethod()

clearText
GSSPluginName setGSSPluginName(String)

getGSSPluginName()

No default value
GSSPluginObject setGSSPluginObject()

getGSSPluginObject()

No default value
Password setPassword(String)

getPassword()

No default value
User setUser(String)

getUser()

No default value

Proxy server properties

The following table summarizes proxy server connection properties.

Property Data Source Method Default
ProxyHost setProxyHost(String)

getProxyHost()

No default value
ProxyPassword setProxyPassword(String)

getProxyPassword()

No default value
ProxyPort setProxyPort(Int)

getProxyPort()

0
ProxyUser setProxyUser(String)

getProxyUser()

No default value

Db2 package properties

The following table summarizes the connection properties required for creating Db2 packages.

Property Data Source Method Default
CreateDefaultPackage setCreateDefaultPackage(Boolean)

getCreateDefaultPackage()

false
DynamicSections setDynamicSections(Int)

getDynamicSections()

200 (prepared statements)
PackageCollection setPackageCollection(String)

getPackageCollection()

NULLID
PackageOwner setPackageOwner(String)

getPackageOwner()

NULL
ReplacePackage setReplacePackage(Boolean)

getReplacePackage()

false

TLS/SSL encryption properties

The following table summarizes the connection properties required for TLS/SSL encryption.

Property Data Source Method Default
CryptoProtocolVersion setCryptoProtocolVersion(String)

getCryptoProtocolVersion()

TLSv1.3
EncryptionMethod setEncryptionMethod(String)

getEncryptionMethod()

noEncryption
HostNameInCertificate setHostNameInCertificate(String)

getHostNameInCertificate()

No default value
KeyPassword setKeyPassword(String)

getKeyPassword()

No default value
KeyStore setKeyStore(String)

getKeyStore()

No default value
KeyStorePassword setKeyStorePassword(String)

getKeyStorePassword()

No default value
TrustStore setTrustStore(String)

getTrustStore()

No default value
TrustStorePassword setTrustStorePassword(String)

getTrustStorePassword()

No default value
ValidateServerCertificate setValidateServerCertificate(Boolean)

getValidateServerCertificate()

true

Bulk load properties

The following table contains the only connection property that affects how bulk load works with the driver.

Property Data Source Method Default
BulkLoadBatchSize setBulkLoadBatchSize(Long)

getBulkLoadBatchSize()

2048

Failover properties

The following table summarizes the connection properties used for configuring failover.

Property Data Source Method Default
AlternateID setAlternateID(String)

getAlternateID()

No default value
AlternateServers setAlternateServers(String)

getAlternateServers()

No default value
ConnectionRetryCount setConnectionRetryCount(Int)

getConnectionRetryCount()

5
ConnectionRetryDelay setConnectionRetryDelay(Int)

getConnectionRetryDelay()

1 (second)
FailoverGranularity setFailoverGranularity(String)

getFailoverGranularity()

nonAtomic
FailoverMode setFailoverMode(String)

getFailoverMode()

connect
FailoverPreconnect setFailoverPreconnect(Boolean)

getFailoverPreconnect()

false
LoadBalancing setLoadBalancing(Boolean)

getLoadBalancing()

false

Timeout properties

The following table summarizes timeout connection properties.

Property Data Source Method Default
LoginTimeout setLoginTimeout(Int)

getLoginTimeout()

0
QueryTimeout setQueryTimeout(Int)

getQueryTimeout()

0

Client information properties

The following table summarizes connection properties that can be used to return client information.

Property Data Source Method Default
AccountingInfo setAccountingInfo(String)

getAccountingInfo()

No default value
ApplicationName setApplicationName(String)

getApplicationName()

No default value
ClientHostName setClientHostName(String)

getClientHostName()

No default value
ClientUser setClientUser(String)

getClientUser()

No default value
ProgramID setProgramID(String)

getProgramID()

No default value

Statement pooling properties

The following table summarizes statement pooling connection properties.

Property Data Source Method Default
ImportStatementPool setImportStatementPool(String)

getImportStatementPool()

No default value
MaxPooledStatements setMaxPooledStatements(Int)

getMaxPooledStatements()

0
RegisterStatementPoolMonitorMBean setRegisterStatementPoolMonitor MBean(Boolean)

getRegisterStatementPoolMonitor MBean()

false

Additional properties

The following table summarizes additional connection properties.

Property Data Source Method Default
AddToCreateTable setAddToCreateTable(String)

getAddToCreateTable()

No default value
AllowImplicitResultSetCloseForXA setAllowImplicitResultSetClose ForXA(Boolean)

getAllowImplicitResultSetClose ForXA()

false
CatalogOptions setCatalogOptions(Int)

getCatalogOptions()

2
CatalogSchema setCatalogSchema(String)

getCatalogSchema()

SYSCAT (Db2 for Linux/UNIX/Windows)

SYSIBM (Db2 for z/OS)

QSYS2 (Db2 for i)

CharsetFor65535 setCharsetFor65535(String)

getCharsetFor65535()

No default value
CodePageOverride setCodePageOverride(String)

getCodePageOverride()

No default value
ConcurrentAccessResolution setConcurrentAccessResolution (String)

getConcurrentAccessResolution()

auto
ConvertNull setConvertNull(Int)

getConvertNull()

1
CurrentFunctionPath setCurrentFunctionPath(String)

getCurrentFunctionPath()

null
CurrentQueryOptimization setCurrentQueryOptimization(Int)

getCurrentQueryOptimization()

-1
EnableCancelTimeout setEnableCancelTimeout(Boolean)

getEnableCancelTimeout()

false
Grantee setGrantee(String)

getGrantee()

PUBLIC
GrantExecute setGrantExecute(Boolean)

getGrantExecute()

true
InitializationString setInitializationString(String)

getInitializationString()

No default value
InsensitiveResultSetBufferSize setInsensitiveResultSetBuffer Size(Int)

getInsensitiveResultSetBufferSize()

2048
JavaDoubleToString setJavaDoubleToString(Boolean)

getJavaDoubleToString()

false
JDBCBehavior setJDBCBehavior(Int)

getJDBCBehavior()

1
KeepAlive setKeepAlive(Boolean)

getKeepAlive()

false
LobStreamingProtocol setLobStreamingProtocol(String)

getLobStreamingProtocol()

streaming
LongDataCacheSize setLongDataCacheSize(Int)

getLongDataCacheSize()

2048
OptimizationProfile setOptimizationProfile(String)

getOptimizationProfile()

null
OptimizationProfileToFlush setOptimizationProfileToFlush (String)

getOptimizationProfileToFlush()

null
ResultSetMetaDataOptions setResultSetMetaDataOptions(Int)

getResultSetMetaDataOptions()

0
SendStreamAsBlob setSendStreamAsBlob(Boolean)

getSendStreamAsBlob()

false
StripNewlines setStripNewlines(Boolean)

getStripNewlines()

false
SpyAttributes setSpyAttributes(String)

getSpyAttributes()

No default value
UseCurrentSchema setUseCurrentSchema(Boolean)

getUseCurrentSchema()

false
WithHoldCursors setWithHoldCursors(Boolean)

getWithHoldCursors()

true
XMLDescribeType setXMLDescribeType(String)

getXMLDescribeType()

No default value