Package io.vertx.db2client
Class DB2ConnectOptions
- java.lang.Object
-
- io.vertx.sqlclient.SqlConnectOptions
-
- io.vertx.db2client.DB2ConnectOptions
-
public class DB2ConnectOptions extends SqlConnectOptions
Connect options for configuringDB2Connection
orDB2Builder
.
-
-
Field Summary
Fields Modifier and Type Field 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_SSL
static boolean
DEFAULT_USE_AFFECTED_ROWS
-
Fields inherited from class io.vertx.sqlclient.SqlConnectOptions
DEFAULT_CACHE_PREPARED_STATEMENTS, DEFAULT_METRICS_NAME, DEFAULT_PREPARED_STATEMENT_CACHE_FILTER, DEFAULT_PREPARED_STATEMENT_CACHE_MAX_SIZE, DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL
-
-
Constructor Summary
Constructors Constructor Description DB2ConnectOptions()
DB2ConnectOptions(JsonObject json)
DB2ConnectOptions(DB2ConnectOptions other)
DB2ConnectOptions(SqlConnectOptions other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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 aDB2ConnectOptions
configured from a connection URI.int
getPipeliningLimit()
int
hashCode()
protected void
init()
Initialize with the default options.boolean
isSsl()
DB2ConnectOptions
merge(JsonObject other)
Returns new options created after this object and merged with theother
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
setPassword(String password)
Specify the user password to be used for the authentication.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 enabledDB2ConnectOptions
setSslOptions(ClientSSLOptions sslOptions)
DB2ConnectOptions
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the client behavior when Vert.x has tracing enabled.DB2ConnectOptions
setUser(String user)
Specify the user account to be used for the authentication.JsonObject
toJson()
static DB2ConnectOptions
wrap(SqlConnectOptions options)
-
Methods inherited from class io.vertx.sqlclient.SqlConnectOptions
getCachePreparedStatements, getDatabase, getHost, getMetricsName, getPassword, getPort, getPreparedStatementCacheMaxSize, getPreparedStatementCacheSqlFilter, getProperties, getReconnectAttempts, getReconnectInterval, getSocketAddress, getSslOptions, getTracingPolicy, getUser, isUsingDomainSocket, setMetricsName, setReconnectAttempts, setReconnectInterval
-
-
-
-
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_SSL
public static final boolean DEFAULT_SSL
- See Also:
- Constant Field Values
-
-
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 aDB2ConnectOptions
configured from a connection URI.- Parameters:
connectionUri
- the connection URI to configure from- Returns:
- a
DB2ConnectOptions
parsed from the connection URI - Throws:
IllegalArgumentException
- when theconnectionUri
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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- Parameters:
preparedStatementCacheSqlLimit
- the maximum length limit of SQL string to set- Returns:
- a reference to this, so the API can be used fluently
-
isSsl
public boolean isSsl()
- Returns:
- is SSL/TLS enabled?
-
setSsl
public DB2ConnectOptions setSsl(boolean ssl)
Set whether SSL/TLS is enabled- Parameters:
ssl
- true if enabled- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- 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 classSqlConnectOptions
- Parameters:
key
- the value of property keyvalue
- the value of property value- Returns:
- a reference to this, so the API can be used fluently
-
setSslOptions
public DB2ConnectOptions setSslOptions(ClientSSLOptions sslOptions)
- Overrides:
setSslOptions
in classSqlConnectOptions
-
init
protected void init()
Initialize with the default options.- Overrides:
init
in classSqlConnectOptions
-
toJson
public JsonObject toJson()
- Overrides:
toJson
in classSqlConnectOptions
-
merge
public DB2ConnectOptions merge(JsonObject other)
Description copied from class:SqlConnectOptions
Returns new options created after this object and merged with theother
json config.- Overrides:
merge
in classSqlConnectOptions
- Parameters:
other
- the other JSON object- Returns:
- new options created after this object and merged with the
other
json config
-
-