io.vertx.db2client

## Class DB2ConnectOptions

- java.lang.Object
- - io.vertx.core.net.NetworkOptions
  - - io.vertx.core.net.TCPSSLOptions
    - - io.vertx.core.net.ClientOptionsBase
      - - io.vertx.core.net.NetClientOptions
        - - io.vertx.sqlclient.SqlConnectOptions
          - - io.vertx.db2client.DB2ConnectOptions

-     public class DB2ConnectOptions
      extends SqlConnectOptions

  Connect options for configuring `DB2Connection` or `DB2Pool`.

- - ### Field Summary

    Fields
    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`

    - ### Fields inherited from class io.vertx.sqlclient.SqlConnectOptions

      `DEFAULT_CACHE_PREPARED_STATEMENTS, DEFAULT_PREPARED_STATEMENT_CACHE_FILTER, DEFAULT_PREPARED_STATEMENT_CACHE_MAX_SIZE, DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT`

    - ### Fields inherited from class io.vertx.core.net.NetClientOptions

      `DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL, DEFAULT_REGISTER_WRITE_HANDLER`

    - ### Fields inherited from class io.vertx.core.net.ClientOptionsBase

      `DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL`

    - ### Fields inherited from class io.vertx.core.net.TCPSSLOptions

      `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`

    - ### Fields inherited from class io.vertx.core.net.NetworkOptions

      `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 Summary

    Constructors
    Constructor and Description
    `DB2ConnectOptions()`
    `DB2ConnectOptions(DB2ConnectOptions other)`
    `DB2ConnectOptions(JsonObject json)`
    `DB2ConnectOptions(SqlConnectOptions other)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    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)`

    - ### Methods inherited from class io.vertx.sqlclient.SqlConnectOptions

      `getCachePreparedStatements, getDatabase, getHost, getPassword, getPort, getPreparedStatementCacheMaxSize, getPreparedStatementCacheSqlFilter, getProperties, getSocketAddress, getTracingPolicy, getUser, isUsingDomainSocket`

    - ### Methods inherited from class io.vertx.core.net.NetClientOptions

      `addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, addNonProxyHost, getApplicationLayerProtocols, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, isRegisterWriteHandler, removeEnabledCipherSuite, removeEnabledSecureTransportProtocol, setActivityLogDataFormat, setApplicationLayerProtocols, setConnectTimeout, setEnabledSecureTransportProtocols, setHostnameVerificationAlgorithm, setIdleTimeout, setIdleTimeoutUnit, setLocalAddress, setLogActivity, setMetricsName, setNonProxyHosts, setPfxKeyCertOptions, setPfxTrustOptions, setProxyOptions, setReadIdleTimeout, setReceiveBufferSize, setReconnectAttempts, setReconnectInterval, setRegisterWriteHandler, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setTcpCork, setTcpFastOpen, setTcpKeepAlive, setTcpNoDelay, setTcpQuickAck, setTrafficClass, setUseAlpn, setWriteIdleTimeout`

    - ### Methods inherited from class io.vertx.core.net.ClientOptionsBase

      `getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll, setTcpUserTimeout`

    - ### Methods inherited from class io.vertx.core.net.TCPSSLOptions

      `getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn`

    - ### Methods inherited from class io.vertx.core.net.NetworkOptions

      `getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_HOST

          public static final String DEFAULT_HOST

      See Also:
        Constant Field Values

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      See Also:
        Constant Field Values

    - #### DEFAULT_CHARSET

          public static final String DEFAULT_CHARSET

      See Also:
        Constant Field Values

    - #### DEFAULT_USE_AFFECTED_ROWS

          public static final boolean DEFAULT_USE_AFFECTED_ROWS

      See Also:
        Constant Field Values

    - #### DEFAULT_PIPELINING_LIMIT

          public static final int DEFAULT_PIPELINING_LIMIT

      See Also:
        Constant Field Values

    - #### DEFAULT_CONNECTION_ATTRIBUTES

          public static final Map<String,String> DEFAULT_CONNECTION_ATTRIBUTES

  - ### Constructor Detail

    - #### DB2ConnectOptions

          public DB2ConnectOptions()

    - #### DB2ConnectOptions

          public DB2ConnectOptions(JsonObject json)

    - #### DB2ConnectOptions

          public DB2ConnectOptions(SqlConnectOptions other)

    - #### DB2ConnectOptions

          public DB2ConnectOptions(DB2ConnectOptions other)

  - ### Method Detail

    - #### wrap

          public static DB2ConnectOptions wrap(SqlConnectOptions options)

      Returns:
        the `options` as DB2 specific connect options

    - #### fromUri

          public static DB2ConnectOptions fromUri(String connectionUri)
                                           throws IllegalArgumentException

      Provide a `DB2ConnectOptions` configured from a connection URI.
      Parameters:
        `connectionUri` - the connection URI to configure from
      Returns:
        a `DB2ConnectOptions` parsed from the connection URI
      Throws:
        `IllegalArgumentException` - when the `connectionUri` is in an invalid format

    - #### setHost

          public DB2ConnectOptions setHost(String host)

      Description copied from class: `SqlConnectOptions`
      Specify the host for connecting to the server.
      Overrides:
        `setHost` in class `SqlConnectOptions`
      Parameters:
        `host` - the host to specify
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPort

          public DB2ConnectOptions setPort(int port)

      Description copied from class: `SqlConnectOptions`
      Specify the port for connecting to the server.
      Overrides:
        `setPort` in class `SqlConnectOptions`
      Parameters:
        `port` - the port to specify
      Returns:
        a reference to this, so the API can be used fluently

    - #### setUser

          public DB2ConnectOptions setUser(String user)

      Description copied from class: `SqlConnectOptions`
      Specify the user account to be used for the authentication.
      Overrides:
        `setUser` in class `SqlConnectOptions`
      Parameters:
        `user` - the user to specify
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPassword

          public DB2ConnectOptions setPassword(String password)

      Description copied from class: `SqlConnectOptions`
      Specify the user password to be used for the authentication.
      Overrides:
        `setPassword` in class `SqlConnectOptions`
      Parameters:
        `password` - the password to specify
      Returns:
        a reference to this, so the API can be used fluently

    - #### setDatabase

          public DB2ConnectOptions setDatabase(String database)

      Description copied from class: `SqlConnectOptions`
      Specify the default database for the connection.
      Overrides:
        `setDatabase` in class `SqlConnectOptions`
      Parameters:
        `database` - the database name to specify
      Returns:
        a reference to this, so the API can be used fluently

    - #### setCachePreparedStatements

          public DB2ConnectOptions setCachePreparedStatements(boolean cachePreparedStatements)

      Description copied from class: `SqlConnectOptions`
      Set whether prepared statements cache should be enabled.
      Overrides:
        `setCachePreparedStatements` in class `SqlConnectOptions`
      Parameters:
        `cachePreparedStatements` - true if cache should be enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPreparedStatementCacheMaxSize

          public DB2ConnectOptions setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)

      Description copied from class: `SqlConnectOptions`
      Set the maximum number of prepared statements that the connection will cache.
      Overrides:
        `setPreparedStatementCacheMaxSize` in class `SqlConnectOptions`
      Parameters:
        `preparedStatementCacheMaxSize` - the size to set
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPreparedStatementCacheSqlFilter

          public DB2ConnectOptions setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)

      Description copied from class: `SqlConnectOptions`
      Set a predicate filtering prepared statements that the connection will cache.

      The default predicate accepts predicate having query length < `SqlConnectOptions.DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT`

      Overrides:
        `setPreparedStatementCacheSqlFilter` in class `SqlConnectOptions`
      Parameters:
        `predicate` - the filter

    - #### setPreparedStatementCacheSqlLimit

          public DB2ConnectOptions setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)

      Description copied from class: `SqlConnectOptions`
      Set the maximum length of prepared statement SQL string that the connection will cache.

      This is an helper setting the `SqlConnectOptions.setPreparedStatementCacheSqlFilter(Predicate)`.

      Overrides:
        `setPreparedStatementCacheSqlLimit` in class `SqlConnectOptions`
      Parameters:
        `preparedStatementCacheSqlLimit` - the maximum length limit of SQL string to set
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSsl

          public DB2ConnectOptions setSsl(boolean ssl)

      Description copied from class: `TCPSSLOptions`
      Set whether SSL/TLS is enabled
      Overrides:
        `setSsl` in class `NetClientOptions`
      Parameters:
        `ssl` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSslHandshakeTimeout

          public DB2ConnectOptions setSslHandshakeTimeout(long sslHandshakeTimeout)

      Description copied from class: `TCPSSLOptions`
      Set the SSL handshake timeout, default time unit is seconds.
      Overrides:
        `setSslHandshakeTimeout` in class `NetClientOptions`
      Parameters:
        `sslHandshakeTimeout` - the SSL handshake timeout to set, in milliseconds
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSslHandshakeTimeoutUnit

          public DB2ConnectOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)

      Description copied from class: `TCPSSLOptions`
      Set the SSL handshake timeout unit. If not specified, default is seconds.
      Overrides:
        `setSslHandshakeTimeoutUnit` in class `NetClientOptions`
      Parameters:
        `sslHandshakeTimeoutUnit` - specify time unit.
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSslEngineOptions

          public DB2ConnectOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)

      Description copied from class: `TCPSSLOptions`
      Set to use SSL engine implementation to use.
      Overrides:
        `setSslEngineOptions` in class `NetClientOptions`
      Parameters:
        `sslEngineOptions` - the ssl engine to use
      Returns:
        a reference to this, so the API can be used fluently

    - #### setJdkSslEngineOptions

          public DB2ConnectOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)

      Overrides:
        `setJdkSslEngineOptions` in class `NetClientOptions`

    - #### setKeyCertOptions

          public DB2ConnectOptions setKeyCertOptions(KeyCertOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert options.
      Overrides:
        `setKeyCertOptions` in class `NetClientOptions`
      Parameters:
        `options` - the key store options
      Returns:
        a reference to this, so the API can be used fluently

    - #### setKeyStoreOptions

          public DB2ConnectOptions setKeyStoreOptions(JksOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert options in jks format, aka Java keystore.
      Overrides:
        `setKeyStoreOptions` in class `NetClientOptions`
      Parameters:
        `options` - the key store in jks format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setOpenSslEngineOptions

          public DB2ConnectOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)

      Overrides:
        `setOpenSslEngineOptions` in class `NetClientOptions`

    - #### setPemKeyCertOptions

          public DB2ConnectOptions setPemKeyCertOptions(PemKeyCertOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert store options in pem format.
      Overrides:
        `setPemKeyCertOptions` in class `NetClientOptions`
      Parameters:
        `options` - the options in pem format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPemTrustOptions

          public DB2ConnectOptions setPemTrustOptions(PemTrustOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in pem format
      Overrides:
        `setPemTrustOptions` in class `NetClientOptions`
      Parameters:
        `options` - the trust options in pem format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrustAll

          public DB2ConnectOptions setTrustAll(boolean trustAll)

      Description copied from class: `ClientOptionsBase`
      Set whether all server certificates should be trusted
      Overrides:
        `setTrustAll` in class `NetClientOptions`
      Parameters:
        `trustAll` - true if all should be trusted
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrustOptions

          public DB2ConnectOptions setTrustOptions(TrustOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options.
      Overrides:
        `setTrustOptions` in class `NetClientOptions`
      Parameters:
        `options` - the trust options
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrustStoreOptions

          public DB2ConnectOptions setTrustStoreOptions(JksOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in jks format, aka Java truststore
      Overrides:
        `setTrustStoreOptions` in class `NetClientOptions`
      Parameters:
        `options` - the trust options in jks format
      Returns:
        a reference to this, so the API can be used fluently

    - #### getPipeliningLimit

          public int getPipeliningLimit()

    - #### setPipeliningLimit

          @Deprecated
          public DB2ConnectOptions setPipeliningLimit(int pipeliningLimit)

      Deprecated. UNSTABLE FEATURE: Current default value is 1, anything higher than 1 will result in errors currently.
      Parameters:
        `pipeliningLimit` - the number of commands that can simultaneously use the same physical socket connection.
      Returns:
        A reference to this, so the API can be used fluently

    - #### setTracingPolicy

          public DB2ConnectOptions setTracingPolicy(TracingPolicy tracingPolicy)

      Description copied from class: `SqlConnectOptions`
      Set the tracing policy for the client behavior when Vert.x has tracing enabled.
      Overrides:
        `setTracingPolicy` in class `SqlConnectOptions`
      Parameters:
        `tracingPolicy` - the tracing policy
      Returns:
        a reference to this, so the API can be used fluently

    - #### setProperties

          public DB2ConnectOptions setProperties(Map<String,String> properties)

      Description copied from class: `SqlConnectOptions`
      Set properties for this client, which will be sent to server at the connection start.
      Overrides:
        `setProperties` in class `SqlConnectOptions`
      Parameters:
        `properties` - the value of properties to specify
      Returns:
        a reference to this, so the API can be used fluently

    - #### addProperty

          public DB2ConnectOptions addProperty(String key,
                                               String value)

      Description copied from class: `SqlConnectOptions`
      Add a property for this client, which will be sent to server at the connection start.
      Overrides:
        `addProperty` in class `SqlConnectOptions`
      Parameters:
        `key` - the value of property key
        `value` - the value of property value
      Returns:
        a reference to this, so the API can be used fluently

    - #### init

          protected void init()

      Initialize with the default options.
      Overrides:
        `init` in class `SqlConnectOptions`

    - #### toJson

          public JsonObject toJson()

      Description copied from class: `ClientOptionsBase`
      Convert to JSON
      Overrides:
        `toJson` in class `SqlConnectOptions`
      Returns:
        the JSON

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### merge

          public DB2ConnectOptions merge(JsonObject other)

      Description copied from class: `SqlConnectOptions`
      Returns new options created after this object and merged with the `other` json config.
      Overrides:
        `merge` in class `SqlConnectOptions`
      Parameters:
        `other` - the other JSON object
      Returns:
        new options created after this object and merged with the `other` json config

Copyright © 2023 Eclipse. All rights reserved.