public class SqlConnectOptions extends NetClientOptions
SqlConnection or Pool.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_CACHE_PREPARED_STATEMENTS |
static java.util.function.Predicate<String> |
DEFAULT_PREPARED_STATEMENT_CACHE_FILTER |
static int |
DEFAULT_PREPARED_STATEMENT_CACHE_MAX_SIZE |
static int |
DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT |
DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVALDEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALLDEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, 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_USE_ALPNDEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS| Constructor and Description |
|---|
SqlConnectOptions() |
SqlConnectOptions(JsonObject json) |
SqlConnectOptions(SqlConnectOptions other) |
| Modifier and Type | Method and Description |
|---|---|
SqlConnectOptions |
addProperty(String key,
String value)
Add a property for this client, which will be sent to server at the connection start.
|
boolean |
getCachePreparedStatements()
Get whether prepared statements cache is enabled.
|
String |
getDatabase()
Get the default database name for the connection.
|
String |
getHost()
Get the host for connecting to the server.
|
String |
getPassword()
Get the user password to be used for the authentication.
|
int |
getPort()
Get the port for connecting to the server.
|
int |
getPreparedStatementCacheMaxSize()
Get the maximum number of prepared statements that the connection will cache.
|
java.util.function.Predicate<String> |
getPreparedStatementCacheSqlFilter()
Get the predicate filtering prepared statements that the connection will cache.
|
Map<String,String> |
getProperties() |
SocketAddress |
getSocketAddress() |
TracingPolicy |
getTracingPolicy() |
String |
getUser()
Get the user account to be used for the authentication.
|
protected void |
init()
Initialize with the default options.
|
SqlConnectOptions |
setCachePreparedStatements(boolean cachePreparedStatements)
Set whether prepared statements cache should be enabled.
|
SqlConnectOptions |
setDatabase(String database)
Specify the default database for the connection.
|
SqlConnectOptions |
setHost(String host)
Specify the host for connecting to the server.
|
SqlConnectOptions |
setPassword(String password)
Specify the user password to be used for the authentication.
|
SqlConnectOptions |
setPort(int port)
Specify the port for connecting to the server.
|
SqlConnectOptions |
setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
Set the maximum number of prepared statements that the connection will cache.
|
SqlConnectOptions |
setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
Set a predicate filtering prepared statements that the connection will cache.
|
SqlConnectOptions |
setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
Set the maximum length of prepared statement SQL string that the connection will cache.
|
SqlConnectOptions |
setProperties(Map<String,String> properties)
Set properties for this client, which will be sent to server at the connection start.
|
SqlConnectOptions |
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the client behavior when Vert.x has tracing enabled.
|
SqlConnectOptions |
setUser(String user)
Specify the user account to be used for the authentication.
|
JsonObject |
toJson()
Convert to JSON
|
addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, removeEnabledSecureTransportProtocol, setConnectTimeout, setEnabledSecureTransportProtocols, setHostnameVerificationAlgorithm, setIdleTimeout, setIdleTimeoutUnit, setJdkSslEngineOptions, setKeyCertOptions, setKeyStoreOptions, setLocalAddress, setLogActivity, setMetricsName, setOpenSslEngineOptions, setPemKeyCertOptions, setPemTrustOptions, setPfxKeyCertOptions, setPfxTrustOptions, setProxyOptions, setReceiveBufferSize, setReconnectAttempts, setReconnectInterval, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setSsl, setSslEngineOptions, setSslHandshakeTimeout, setSslHandshakeTimeoutUnit, setTcpCork, setTcpFastOpen, setTcpKeepAlive, setTcpNoDelay, setTcpQuickAck, setTrafficClass, setTrustAll, setTrustOptions, setTrustStoreOptions, setUseAlpngetConnectTimeout, getLocalAddress, getMetricsName, getProxyOptions, isTrustAllgetCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getTrustOptions, getTrustStoreOptions, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpngetLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePortpublic static final boolean DEFAULT_CACHE_PREPARED_STATEMENTS
public static final int DEFAULT_PREPARED_STATEMENT_CACHE_MAX_SIZE
public static final int DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT
public static final java.util.function.Predicate<String> DEFAULT_PREPARED_STATEMENT_CACHE_FILTER
public SqlConnectOptions()
public SqlConnectOptions(JsonObject json)
public SqlConnectOptions(SqlConnectOptions other)
public String getHost()
public SqlConnectOptions setHost(String host)
host - the host to specifypublic int getPort()
public SqlConnectOptions setPort(int port)
port - the port to specifypublic String getUser()
public SqlConnectOptions setUser(String user)
user - the user to specifypublic String getPassword()
public SqlConnectOptions setPassword(String password)
password - the password to specifypublic String getDatabase()
public SqlConnectOptions setDatabase(String database)
database - the database name to specifypublic boolean getCachePreparedStatements()
public SqlConnectOptions setCachePreparedStatements(boolean cachePreparedStatements)
cachePreparedStatements - true if cache should be enabledpublic int getPreparedStatementCacheMaxSize()
public SqlConnectOptions setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
preparedStatementCacheMaxSize - the size to setpublic java.util.function.Predicate<String> getPreparedStatementCacheSqlFilter()
public SqlConnectOptions setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
The default predicate accepts predicate having query length < DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT
predicate - the filterpublic SqlConnectOptions setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
This is an helper setting the setPreparedStatementCacheSqlFilter(Predicate).
preparedStatementCacheSqlLimit - the maximum length limit of SQL string to setpublic Map<String,String> getProperties()
public SqlConnectOptions setProperties(Map<String,String> properties)
properties - the value of properties to specifypublic SqlConnectOptions addProperty(String key, String value)
key - the value of property keyvalue - the value of property valuepublic SocketAddress getSocketAddress()
public TracingPolicy getTracingPolicy()
public SqlConnectOptions setTracingPolicy(TracingPolicy tracingPolicy)
tracingPolicy - the tracing policypublic JsonObject toJson()
ClientOptionsBasetoJson in class ClientOptionsBaseprotected void init()
Copyright © 2021 Eclipse. All rights reserved.