Package org.mariadb.jdbc
Class Configuration.Builder
java.lang.Object
org.mariadb.jdbc.Configuration.Builder
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- Configuration
A builder for
Configuration
instances.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<HostAddress>
private HaMode
private Properties
private Boolean
private Boolean
private Boolean
private Boolean
private Boolean
private Boolean
private String
private Integer
private String
private String
private Integer
private Boolean
private String
private String
private String
private String
private Boolean
private Boolean
private String
private String
private String
private String
private String
private Integer
private Integer
private Integer
private Integer
private String
private String
private Boolean
private String
private Integer
private Integer
private Boolean
private String
private Integer
private String
private String
private String
private String
private String
private Integer
private String
private Boolean
private Boolean
private Integer
private Integer
private Integer
private String
private Boolean
private String
private String
private Boolean
private Boolean
private Boolean
private Boolean
private Boolean
private String
private Boolean
private Boolean
private Boolean
private Boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddresses
(HostAddress... hostAddress) allowLocalInfile
(Boolean allowLocalInfile) Indicate if LOAD DATA LOCAL INFILE are permitted.allowMultiQueries
(Boolean allowMultiQueries) Indicate that multi-queries are allowed.allowPublicKeyRetrieval
(Boolean allowPublicKeyRetrieval) autocommit
(Boolean autocommit) blankTableNameMeta
(Boolean blankTableNameMeta) build()
cachePrepStmts
(Boolean cachePrepStmts) connectionAttributes
(String connectionAttributes) connectTimeout
(Integer connectTimeout) Indicate connect timeout value, in milliseconds, or zero for no timeout.credentialType
(String credentialType) defaultFetchSize
(Integer defaultFetchSize) dumpQueriesOnException
(Boolean dumpQueriesOnException) enabledSslCipherSuites
(String enabledSslCipherSuites) enabledSslProtocolSuites
(String enabledSslProtocolSuites) galeraAllowedState
(String galeraAllowedState) geometryDefaultType
(String geometryDefault) Indicate what default Object type Geometry a resultset.getObject must return.includeInnodbStatusInDeadlockExceptions
(Boolean includeInnodbStatusInDeadlockExceptions) includeThreadDumpInDeadlockExceptions
(Boolean includeThreadDumpInDeadlockExceptions) File path of the keyStore file that contain client private key store and associate certificates (similar to java System property \"javax.net.ssl.keyStore\", but ensure that only the private key's entries are used)keyStorePassword
(String keyStorePassword) Client keystore passwordkeyStoreType
(String keyStoreType) localSocket
(String localSocket) Indicate to use Unix domain socket, if the server allows it, specifying named pipe name to connect The value is the path of Unix domain socket (available with "select @@socket" command).localSocketAddress
(String localSocketAddress) Indicate Hostname or IP address to bind the connection socket to a local (UNIX domain) socket.maxIdleTime
(Integer maxIdleTime) maxPoolSize
(Integer maxPoolSize) maxQuerySizeToLog
(Integer maxQuerySizeToLog) minPoolSize
(Integer minPoolSize) Indicate to use windows named pipe, specify named pipe name to connectpoolValidMinDelay
(Integer poolValidMinDelay) prepStmtCacheSize
(Integer prepStmtCacheSize) registerJmxPool
(Boolean registerJmxPool) restrictedAuth
(String restrictedAuth) restrict authentication method to secure list.retriesAllDown
(Integer retriesAllDown) serverRsaPublicKeyFile
(String serverRsaPublicKeyFile) serverSslCert
(String serverSslCert) servicePrincipalName
(String servicePrincipalName) sessionVariables
(String sessionVariables) socketFactory
(String socketFactory) socketTimeout
(Integer socketTimeout) Indicate the network socket timeout (SO_TIMEOUT) in milliseconds.tcpAbortiveClose
(Boolean tcpAbortiveClose) Indicate that when connection fails, to send an RST TCP packet.tcpKeepAlive
(Boolean tcpKeepAlive) Indicate if TCP keep-alive must be enabled.tcpKeepCount
(Integer tcpKeepCount) Indicate TCP keep-count value (for java 11+ only).tcpKeepIdle
(Integer tcpKeepIdle) Indicate TCP keep-idle value (for java 11+ only).tcpKeepInterval
(Integer tcpKeepInterval) Indicate TCP keep-interval value (for java 11+ only).tinyInt1isBit
(Boolean tinyInt1isBit) tlsSocketType
(String tlsSocketType) transactionIsolation
(String transactionIsolation) transactionReplay
(Boolean transactionReplay) useAffectedRows
(Boolean useAffectedRows) useBulkStmts
(Boolean useBulkStmts) useCompression
(Boolean useCompression) Indicate to compress exchanges with the database through gzip.useMysqlMetadata
(Boolean useMysqlMetadata) Permit indicating to force DatabaseMetadata.getDatabaseProductName() to return `MySQL` as database type, not real database typeuseReadAheadInput
(Boolean useReadAheadInput) useResetConnection
(Boolean useResetConnection) useServerPrepStmts
(Boolean useServerPrepStmts) yearIsDateType
(Boolean yearIsDateType)
-
Field Details
-
_nonMappedOptions
-
_haMode
-
_addresses
-
user
-
password
-
database
-
timezone
-
autocommit
-
useMysqlMetadata
-
defaultFetchSize
-
maxQuerySizeToLog
-
geometryDefaultType
-
restrictedAuth
-
transactionIsolation
-
socketFactory
-
connectTimeout
-
pipe
-
localSocket
-
tcpKeepAlive
-
tcpKeepIdle
-
tcpKeepCount
-
tcpKeepInterval
-
tcpAbortiveClose
-
localSocketAddress
-
socketTimeout
-
useReadAheadInput
-
tlsSocketType
-
sslMode
-
serverSslCert
-
keyStore
-
keyStorePassword
-
keyStoreType
-
enabledSslCipherSuites
-
enabledSslProtocolSuites
-
allowMultiQueries
-
allowLocalInfile
-
useCompression
-
useAffectedRows
-
useBulkStmts
-
cachePrepStmts
-
prepStmtCacheSize
-
useServerPrepStmts
-
credentialType
-
sessionVariables
-
connectionAttributes
-
servicePrincipalName
-
blankTableNameMeta
-
tinyInt1isBit
-
yearIsDateType
-
dumpQueriesOnException
-
includeInnodbStatusInDeadlockExceptions
-
includeThreadDumpInDeadlockExceptions
-
retriesAllDown
-
galeraAllowedState
-
transactionReplay
-
pool
-
poolName
-
maxPoolSize
-
minPoolSize
-
maxIdleTime
-
registerJmxPool
-
poolValidMinDelay
-
useResetConnection
-
serverRsaPublicKeyFile
-
allowPublicKeyRetrieval
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
user
-
serverSslCert
-
keyStore
File path of the keyStore file that contain client private key store and associate certificates (similar to java System property \"javax.net.ssl.keyStore\", but ensure that only the private key's entries are used)- Parameters:
keyStore
- client store certificates- Returns:
- this
Configuration.Builder
-
keyStorePassword
Client keystore password- Parameters:
keyStorePassword
- client store password- Returns:
- this
Configuration.Builder
-
keyStoreType
-
password
-
enabledSslProtocolSuites
-
database
-
haMode
-
addHost
-
addHost
-
addresses
-
socketFactory
-
connectTimeout
Indicate connect timeout value, in milliseconds, or zero for no timeout. Default: 30000- Parameters:
connectTimeout
- connect Timeout- Returns:
- this
Configuration.Builder
-
pipe
Indicate to use windows named pipe, specify named pipe name to connect- Parameters:
pipe
- windows named pipe- Returns:
- this
Configuration.Builder
-
localSocket
Indicate to use Unix domain socket, if the server allows it, specifying named pipe name to connect The value is the path of Unix domain socket (available with "select @@socket" command).- Parameters:
localSocket
- local socket path- Returns:
- this
Configuration.Builder
-
tcpKeepAlive
Indicate if TCP keep-alive must be enabled.- Parameters:
tcpKeepAlive
- value- Returns:
- this
Configuration.Builder
-
tcpKeepIdle
Indicate TCP keep-idle value (for java 11+ only).- Parameters:
tcpKeepIdle
- value- Returns:
- this
Configuration.Builder
-
tcpKeepCount
Indicate TCP keep-count value (for java 11+ only).- Parameters:
tcpKeepCount
- value- Returns:
- this
Configuration.Builder
-
tcpKeepInterval
Indicate TCP keep-interval value (for java 11+ only).- Parameters:
tcpKeepInterval
- value- Returns:
- this
Configuration.Builder
-
tcpAbortiveClose
Indicate that when connection fails, to send an RST TCP packet.- Parameters:
tcpAbortiveClose
- value- Returns:
- this
Configuration.Builder
-
geometryDefaultType
Indicate what default Object type Geometry a resultset.getObject must return. possibility :- null or empty is WKB byte array
- 'default' will return org.mariadb.mariadb.jdbc.type Object
- Parameters:
geometryDefault
- value- Returns:
- this
Configuration.Builder
-
restrictedAuth
restrict authentication method to secure list. Default "default".- Parameters:
restrictedAuth
- use authentication plugin list- Returns:
- this
Configuration.Builder
-
localSocketAddress
Indicate Hostname or IP address to bind the connection socket to a local (UNIX domain) socket.- Parameters:
localSocketAddress
- Hostname or IP address- Returns:
- this
Configuration.Builder
-
socketTimeout
Indicate the network socket timeout (SO_TIMEOUT) in milliseconds. Value of 0 disables this timeout.If the goal is to set a timeout for all queries, the server has permitted a solution to limit the query time by setting a system variable, max_statement_time. Default: 0
- Parameters:
socketTimeout
- socket timeout value- Returns:
- this
Configuration.Builder
-
allowMultiQueries
Indicate that multi-queries are allowed. example: "insert into ab (i) values (1); insert into ab (i) values (2)".If application build sql command string, this is probably a bad idea to enable this option, opening the door to sql injection. default: false.
- Parameters:
allowMultiQueries
- indicate if active- Returns:
- this
Configuration.Builder
-
allowLocalInfile
Indicate if LOAD DATA LOCAL INFILE are permitted. This will disable all pipelining implementation.- Parameters:
allowLocalInfile
- indicate if permit LOAD DATA LOCAL INFILE commands- Returns:
- this
Configuration.Builder
-
useCompression
Indicate to compress exchanges with the database through gzip. This permits better performance when the database is not in the same location.- Parameters:
useCompression
- to enable/disable compression- Returns:
- this
Configuration.Builder
-
blankTableNameMeta
-
credentialType
-
sslMode
-
transactionIsolation
-
enabledSslCipherSuites
-
sessionVariables
-
tinyInt1isBit
-
yearIsDateType
-
timezone
-
dumpQueriesOnException
-
prepStmtCacheSize
-
useAffectedRows
-
useServerPrepStmts
-
connectionAttributes
-
useBulkStmts
-
autocommit
-
useMysqlMetadata
Permit indicating to force DatabaseMetadata.getDatabaseProductName() to return `MySQL` as database type, not real database type- Parameters:
useMysqlMetadata
- force DatabaseMetadata.getDatabaseProductName() to return `MySQL`- Returns:
- this
Configuration.Builder
-
includeInnodbStatusInDeadlockExceptions
public Configuration.Builder includeInnodbStatusInDeadlockExceptions(Boolean includeInnodbStatusInDeadlockExceptions) -
includeThreadDumpInDeadlockExceptions
public Configuration.Builder includeThreadDumpInDeadlockExceptions(Boolean includeThreadDumpInDeadlockExceptions) -
servicePrincipalName
-
defaultFetchSize
-
tlsSocketType
-
maxQuerySizeToLog
-
retriesAllDown
-
galeraAllowedState
-
pool
-
poolName
-
maxPoolSize
-
minPoolSize
-
maxIdleTime
-
registerJmxPool
-
poolValidMinDelay
-
useResetConnection
-
serverRsaPublicKeyFile
-
allowPublicKeyRetrieval
-
useReadAheadInput
-
cachePrepStmts
-
transactionReplay
-
build
- Throws:
SQLException
-