public class DB2ConnectOptions extends SqlConnectOptions
DB2Connection
or DB2Pool
.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CHARSET |
static Map<String,String> |
DEFAULT_CONNECTION_ATTRIBUTES |
static String |
DEFAULT_HOST |
static int |
DEFAULT_PIPELINING_LIMIT |
static int |
DEFAULT_PORT |
static boolean |
DEFAULT_USE_AFFECTED_ROWS |
DEFAULT_CACHE_PREPARED_STATEMENTS, DEFAULT_PREPARED_STATEMENT_CACHE_FILTER, DEFAULT_PREPARED_STATEMENT_CACHE_MAX_SIZE, DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT
DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_USE_ALPN, DEFAULT_WRITE_IDLE_TIMEOUT
DEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
Constructor and Description |
---|
DB2ConnectOptions() |
DB2ConnectOptions(DB2ConnectOptions other) |
DB2ConnectOptions(JsonObject json) |
DB2ConnectOptions(SqlConnectOptions other) |
Modifier and Type | Method and Description |
---|---|
DB2ConnectOptions |
addProperty(String key,
String value)
Add a property for this client, which will be sent to server at the connection start.
|
boolean |
equals(Object o) |
static DB2ConnectOptions |
fromUri(String connectionUri)
Provide a
DB2ConnectOptions configured from a connection URI. |
int |
getPipeliningLimit() |
int |
hashCode() |
protected void |
init()
Initialize with the default options.
|
DB2ConnectOptions |
merge(JsonObject other)
Returns new options created after this object and merged with the
other json config. |
DB2ConnectOptions |
setCachePreparedStatements(boolean cachePreparedStatements)
Set whether prepared statements cache should be enabled.
|
DB2ConnectOptions |
setDatabase(String database)
Specify the default database for the connection.
|
DB2ConnectOptions |
setHost(String host)
Specify the host for connecting to the server.
|
DB2ConnectOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
DB2ConnectOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
DB2ConnectOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
DB2ConnectOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
DB2ConnectOptions |
setPassword(String password)
Specify the user password to be used for the authentication.
|
DB2ConnectOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
DB2ConnectOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
DB2ConnectOptions |
setPipeliningLimit(int pipeliningLimit)
Deprecated.
UNSTABLE FEATURE: Current default value is 1, anything higher
than 1 will result in errors currently.
|
DB2ConnectOptions |
setPort(int port)
Specify the port for connecting to the server.
|
DB2ConnectOptions |
setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
Set the maximum number of prepared statements that the connection will cache.
|
DB2ConnectOptions |
setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
Set a predicate filtering prepared statements that the connection will cache.
|
DB2ConnectOptions |
setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
Set the maximum length of prepared statement SQL string that the connection will cache.
|
DB2ConnectOptions |
setProperties(Map<String,String> properties)
Set properties for this client, which will be sent to server at the connection start.
|
DB2ConnectOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
DB2ConnectOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
DB2ConnectOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
DB2ConnectOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
DB2ConnectOptions |
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the client behavior when Vert.x has tracing enabled.
|
DB2ConnectOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
DB2ConnectOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
DB2ConnectOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
DB2ConnectOptions |
setUser(String user)
Specify the user account to be used for the authentication.
|
JsonObject |
toJson()
Convert to JSON
|
static DB2ConnectOptions |
wrap(SqlConnectOptions options) |
getCachePreparedStatements, getDatabase, getHost, getPassword, getPort, getPreparedStatementCacheMaxSize, getPreparedStatementCacheSqlFilter, getProperties, getSocketAddress, getTracingPolicy, getUser, isUsingDomainSocket
addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, addNonProxyHost, getApplicationLayerProtocols, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, removeEnabledCipherSuite, removeEnabledSecureTransportProtocol, setActivityLogDataFormat, setApplicationLayerProtocols, setConnectTimeout, setEnabledSecureTransportProtocols, setHostnameVerificationAlgorithm, setIdleTimeout, setIdleTimeoutUnit, setLocalAddress, setLogActivity, setMetricsName, setNonProxyHosts, setPfxKeyCertOptions, setPfxTrustOptions, setProxyOptions, setReadIdleTimeout, setReceiveBufferSize, setReconnectAttempts, setReconnectInterval, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setTcpCork, setTcpFastOpen, setTcpKeepAlive, setTcpNoDelay, setTcpQuickAck, setTrafficClass, setUseAlpn, setWriteIdleTimeout
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll, setTcpUserTimeout
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
public static final String DEFAULT_HOST
public static final int DEFAULT_PORT
public static final String DEFAULT_CHARSET
public static final boolean DEFAULT_USE_AFFECTED_ROWS
public static final int DEFAULT_PIPELINING_LIMIT
public DB2ConnectOptions()
public DB2ConnectOptions(JsonObject json)
public DB2ConnectOptions(SqlConnectOptions other)
public DB2ConnectOptions(DB2ConnectOptions other)
public static DB2ConnectOptions wrap(SqlConnectOptions options)
options
as DB2 specific connect optionspublic static DB2ConnectOptions fromUri(String connectionUri) throws IllegalArgumentException
DB2ConnectOptions
configured from a connection URI.connectionUri
- the connection URI to configure fromDB2ConnectOptions
parsed from the connection URIIllegalArgumentException
- when the connectionUri
is in an
invalid formatpublic DB2ConnectOptions setHost(String host)
SqlConnectOptions
setHost
in class SqlConnectOptions
host
- the host to specifypublic DB2ConnectOptions setPort(int port)
SqlConnectOptions
setPort
in class SqlConnectOptions
port
- the port to specifypublic DB2ConnectOptions setUser(String user)
SqlConnectOptions
setUser
in class SqlConnectOptions
user
- the user to specifypublic DB2ConnectOptions setPassword(String password)
SqlConnectOptions
setPassword
in class SqlConnectOptions
password
- the password to specifypublic DB2ConnectOptions setDatabase(String database)
SqlConnectOptions
setDatabase
in class SqlConnectOptions
database
- the database name to specifypublic DB2ConnectOptions setCachePreparedStatements(boolean cachePreparedStatements)
SqlConnectOptions
setCachePreparedStatements
in class SqlConnectOptions
cachePreparedStatements
- true if cache should be enabledpublic DB2ConnectOptions setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
SqlConnectOptions
setPreparedStatementCacheMaxSize
in class SqlConnectOptions
preparedStatementCacheMaxSize
- the size to setpublic DB2ConnectOptions setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
SqlConnectOptions
The default predicate accepts predicate having query length < SqlConnectOptions.DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT
setPreparedStatementCacheSqlFilter
in class SqlConnectOptions
predicate
- the filterpublic DB2ConnectOptions setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
SqlConnectOptions
This is an helper setting the SqlConnectOptions.setPreparedStatementCacheSqlFilter(Predicate)
.
setPreparedStatementCacheSqlLimit
in class SqlConnectOptions
preparedStatementCacheSqlLimit
- the maximum length limit of SQL string to setpublic DB2ConnectOptions setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class NetClientOptions
ssl
- true if enabledpublic DB2ConnectOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptions
setSslHandshakeTimeout
in class NetClientOptions
sslHandshakeTimeout
- the SSL handshake timeout to set, in millisecondspublic DB2ConnectOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptions
setSslHandshakeTimeoutUnit
in class NetClientOptions
sslHandshakeTimeoutUnit
- specify time unit.public DB2ConnectOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class NetClientOptions
sslEngineOptions
- the ssl engine to usepublic DB2ConnectOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class NetClientOptions
public DB2ConnectOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class NetClientOptions
options
- the key store optionspublic DB2ConnectOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class NetClientOptions
options
- the key store in jks formatpublic DB2ConnectOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class NetClientOptions
public DB2ConnectOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class NetClientOptions
options
- the options in pem formatpublic DB2ConnectOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class NetClientOptions
options
- the trust options in pem formatpublic DB2ConnectOptions setTrustAll(boolean trustAll)
ClientOptionsBase
setTrustAll
in class NetClientOptions
trustAll
- true if all should be trustedpublic DB2ConnectOptions setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class NetClientOptions
options
- the trust optionspublic DB2ConnectOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class NetClientOptions
options
- the trust options in jks formatpublic int getPipeliningLimit()
@Deprecated public DB2ConnectOptions setPipeliningLimit(int pipeliningLimit)
pipeliningLimit
- the number of commands that can simultaneously use the
same physical socket connection.public DB2ConnectOptions setTracingPolicy(TracingPolicy tracingPolicy)
SqlConnectOptions
setTracingPolicy
in class SqlConnectOptions
tracingPolicy
- the tracing policypublic DB2ConnectOptions setProperties(Map<String,String> properties)
SqlConnectOptions
setProperties
in class SqlConnectOptions
properties
- the value of properties to specifypublic DB2ConnectOptions addProperty(String key, String value)
SqlConnectOptions
addProperty
in class SqlConnectOptions
key
- the value of property keyvalue
- the value of property valueprotected void init()
init
in class SqlConnectOptions
public JsonObject toJson()
ClientOptionsBase
toJson
in class SqlConnectOptions
public DB2ConnectOptions merge(JsonObject other)
SqlConnectOptions
other
json config.merge
in class SqlConnectOptions
other
- the other JSON objectother
json configCopyright © 2023 Eclipse. All rights reserved.