Class Configuration
basic syntax :
jdbc:mariadb:[replication:|failover|loadbalance:|aurora:]//<hostDescription>[,<hostDescription>]/[database>]
[?<key1>=<value1>[&<key2>=<value2>]]
hostDescription:
- simple :
<host>:<portnumber>
(for example localhost:3306)
- complex :
address=[(type=(master|slave))][(port=<portnumber>)](host=<host>)
type is by default master
port is by default 3306
host can be dns name, ipv4 or ipv6.
in case of ipv6 and simple host description, the ip must be written inside bracket.
exemple : jdbc:mariadb://[2001:0660:7401:0200:0000:0000:0edf:bdd7]:3306
Some examples :
jdbc:mariadb://localhost:3306/database?user=greg&password=pass
jdbc:mariadb://address=(type=master)(host=master1),address=(port=3307)(type=slave)(host=slave1)/database?user=greg&password=pass
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<HostAddress>
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private Codec<?>[]
private String
private int
private CredentialPlugin
private String
private int
private boolean
private String
private String
private String
private String
private HaMode
private boolean
private boolean
private String
private String
private String
private String
private String
private String
private int
private int
private int
private int
private Properties
private String
private String
private boolean
private String
private int
private int
private boolean
private String
private int
private String
private String
private String
private String
private String
private int
private SslMode
private boolean
private boolean
private int
private int
private int
private String
private boolean
private String
private TransactionIsolation
private boolean
private static final Pattern
private boolean
private boolean
private boolean
private boolean
private String
private boolean
private boolean
private boolean
private boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
private
Configuration
(String user, String password, String database, List<HostAddress> addresses, HaMode haMode, Properties nonMappedOptions, String timezone, boolean autocommit, boolean useMysqlMetadata, TransactionIsolation transactionIsolation, int defaultFetchSize, int maxQuerySizeToLog, String geometryDefaultType, String restrictedAuth, String socketFactory, int connectTimeout, String pipe, String localSocket, boolean tcpKeepAlive, int tcpKeepIdle, int tcpKeepCount, int tcpKeepInterval, boolean tcpAbortiveClose, String localSocketAddress, int socketTimeout, boolean useReadAheadInput, String tlsSocketType, SslMode sslMode, String serverSslCert, String keyStore, String keyStorePassword, String keyStoreType, String enabledSslCipherSuites, String enabledSslProtocolSuites, boolean allowMultiQueries, boolean allowLocalInfile, boolean useCompression, boolean useAffectedRows, boolean useBulkStmts, boolean cachePrepStmts, int prepStmtCacheSize, boolean useServerPrepStmts, CredentialPlugin credentialType, String sessionVariables, String connectionAttributes, String servicePrincipalName, boolean blankTableNameMeta, boolean tinyInt1isBit, boolean yearIsDateType, boolean dumpQueriesOnException, boolean includeInnodbStatusInDeadlockExceptions, boolean includeThreadDumpInDeadlockExceptions, int retriesAllDown, String galeraAllowedState, boolean transactionReplay, boolean pool, String poolName, int maxPoolSize, int minPoolSize, int maxIdleTime, boolean registerJmxPool, int poolValidMinDelay, boolean useResetConnection, String serverRsaPublicKeyFile, boolean allowPublicKeyRetrieval) private
Configuration
(String database, List<HostAddress> addresses, HaMode haMode, String user, String password, String enabledSslProtocolSuites, String socketFactory, Integer connectTimeout, String pipe, String localSocket, Boolean tcpKeepAlive, Integer tcpKeepIdle, Integer tcpKeepCount, Integer tcpKeepInterval, Boolean tcpAbortiveClose, String localSocketAddress, Integer socketTimeout, Boolean allowMultiQueries, Boolean allowLocalInfile, Boolean useCompression, Boolean blankTableNameMeta, String credentialType, String sslMode, String transactionIsolation, String enabledSslCipherSuites, String sessionVariables, Boolean tinyInt1isBit, Boolean yearIsDateType, String timezone, Boolean dumpQueriesOnException, Integer prepStmtCacheSize, Boolean useAffectedRows, Boolean useServerPrepStmts, String connectionAttributes, Boolean useBulkStmts, Boolean autocommit, Boolean useMysqlMetadata, Boolean includeInnodbStatusInDeadlockExceptions, Boolean includeThreadDumpInDeadlockExceptions, String servicePrincipalName, Integer defaultFetchSize, String tlsSocketType, Integer maxQuerySizeToLog, Integer retriesAllDown, String galeraAllowedState, Boolean pool, String poolName, Integer maxPoolSize, Integer minPoolSize, Integer maxIdleTime, Boolean registerJmxPool, Integer poolValidMinDelay, Boolean useResetConnection, String serverRsaPublicKeyFile, Boolean allowPublicKeyRetrieval, String serverSslCert, String keyStore, String keyStorePassword, String keyStoreType, Boolean useReadAheadInput, Boolean cachePrepStmts, Boolean transactionReplay, String geometryDefaultType, String restrictedAuth, Properties nonMappedOptions) -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
acceptsUrl
(String url) Tell if mariadb driver accept url string.boolean
boolean
boolean
boolean
boolean
protected static String
buildUrl
(Configuration conf) boolean
Codec<?>[]
codecs()
int
connectTimeout
(int connectTimeout) database()
int
boolean
boolean
haMode()
int
hashCode()
boolean
boolean
private static boolean
isSet
(String key, Properties nonMappedOptions) keyStore()
private void
private static void
mapPropertiesToOption
(Configuration.Builder builder, Properties properties) int
int
int
int
private static String
nullOrEmpty
(String val) static Configuration
static Configuration
parse
(String url, Properties prop) Parse url connection string with additional properties.private static HaMode
parseHaMode
(String url, int separator) private static Configuration
parseInternal
(String url, Properties properties) Parses the connection URL in order to set the UrlParser instance with all the information provided through the URL.password()
pipe()
boolean
pool()
poolName()
int
int
boolean
int
int
sslMode()
boolean
boolean
int
int
int
timezone()
boolean
toString()
ToString implementation.boolean
boolean
boolean
boolean
boolean
user()
boolean
boolean
boolean
boolean
-
Field Details
-
URL_PARAMETER
-
user
-
password
-
database
-
addresses
-
haMode
-
initialUrl
-
nonMappedOptions
-
timezone
-
autocommit
private boolean autocommit -
useMysqlMetadata
private boolean useMysqlMetadata -
transactionIsolation
-
defaultFetchSize
private int defaultFetchSize -
maxQuerySizeToLog
private int maxQuerySizeToLog -
geometryDefaultType
-
restrictedAuth
-
socketFactory
-
connectTimeout
private int connectTimeout -
pipe
-
localSocket
-
tcpKeepAlive
private boolean tcpKeepAlive -
tcpKeepIdle
private int tcpKeepIdle -
tcpKeepCount
private int tcpKeepCount -
tcpKeepInterval
private int tcpKeepInterval -
tcpAbortiveClose
private boolean tcpAbortiveClose -
localSocketAddress
-
socketTimeout
private int socketTimeout -
useReadAheadInput
private boolean useReadAheadInput -
tlsSocketType
-
sslMode
-
serverSslCert
-
keyStore
-
keyStorePassword
-
keyStoreType
-
enabledSslCipherSuites
-
enabledSslProtocolSuites
-
allowMultiQueries
private boolean allowMultiQueries -
allowLocalInfile
private boolean allowLocalInfile -
useCompression
private boolean useCompression -
useAffectedRows
private boolean useAffectedRows -
useBulkStmts
private boolean useBulkStmts -
cachePrepStmts
private boolean cachePrepStmts -
prepStmtCacheSize
private int prepStmtCacheSize -
useServerPrepStmts
private boolean useServerPrepStmts -
credentialType
-
sessionVariables
-
connectionAttributes
-
servicePrincipalName
-
blankTableNameMeta
private boolean blankTableNameMeta -
tinyInt1isBit
private boolean tinyInt1isBit -
yearIsDateType
private boolean yearIsDateType -
dumpQueriesOnException
private boolean dumpQueriesOnException -
includeInnodbStatusInDeadlockExceptions
private boolean includeInnodbStatusInDeadlockExceptions -
includeThreadDumpInDeadlockExceptions
private boolean includeThreadDumpInDeadlockExceptions -
retriesAllDown
private int retriesAllDown -
galeraAllowedState
-
transactionReplay
private boolean transactionReplay -
pool
private boolean pool -
poolName
-
maxPoolSize
private int maxPoolSize -
minPoolSize
private int minPoolSize -
maxIdleTime
private int maxIdleTime -
registerJmxPool
private boolean registerJmxPool -
poolValidMinDelay
private int poolValidMinDelay -
useResetConnection
private boolean useResetConnection -
serverRsaPublicKeyFile
-
allowPublicKeyRetrieval
private boolean allowPublicKeyRetrieval -
codecs
-
-
Constructor Details
-
Configuration
private Configuration() -
Configuration
private Configuration(String user, String password, String database, List<HostAddress> addresses, HaMode haMode, Properties nonMappedOptions, String timezone, boolean autocommit, boolean useMysqlMetadata, TransactionIsolation transactionIsolation, int defaultFetchSize, int maxQuerySizeToLog, String geometryDefaultType, String restrictedAuth, String socketFactory, int connectTimeout, String pipe, String localSocket, boolean tcpKeepAlive, int tcpKeepIdle, int tcpKeepCount, int tcpKeepInterval, boolean tcpAbortiveClose, String localSocketAddress, int socketTimeout, boolean useReadAheadInput, String tlsSocketType, SslMode sslMode, String serverSslCert, String keyStore, String keyStorePassword, String keyStoreType, String enabledSslCipherSuites, String enabledSslProtocolSuites, boolean allowMultiQueries, boolean allowLocalInfile, boolean useCompression, boolean useAffectedRows, boolean useBulkStmts, boolean cachePrepStmts, int prepStmtCacheSize, boolean useServerPrepStmts, CredentialPlugin credentialType, String sessionVariables, String connectionAttributes, String servicePrincipalName, boolean blankTableNameMeta, boolean tinyInt1isBit, boolean yearIsDateType, boolean dumpQueriesOnException, boolean includeInnodbStatusInDeadlockExceptions, boolean includeThreadDumpInDeadlockExceptions, int retriesAllDown, String galeraAllowedState, boolean transactionReplay, boolean pool, String poolName, int maxPoolSize, int minPoolSize, int maxIdleTime, boolean registerJmxPool, int poolValidMinDelay, boolean useResetConnection, String serverRsaPublicKeyFile, boolean allowPublicKeyRetrieval) -
Configuration
private Configuration(String database, List<HostAddress> addresses, HaMode haMode, String user, String password, String enabledSslProtocolSuites, String socketFactory, Integer connectTimeout, String pipe, String localSocket, Boolean tcpKeepAlive, Integer tcpKeepIdle, Integer tcpKeepCount, Integer tcpKeepInterval, Boolean tcpAbortiveClose, String localSocketAddress, Integer socketTimeout, Boolean allowMultiQueries, Boolean allowLocalInfile, Boolean useCompression, Boolean blankTableNameMeta, String credentialType, String sslMode, String transactionIsolation, String enabledSslCipherSuites, String sessionVariables, Boolean tinyInt1isBit, Boolean yearIsDateType, String timezone, Boolean dumpQueriesOnException, Integer prepStmtCacheSize, Boolean useAffectedRows, Boolean useServerPrepStmts, String connectionAttributes, Boolean useBulkStmts, Boolean autocommit, Boolean useMysqlMetadata, Boolean includeInnodbStatusInDeadlockExceptions, Boolean includeThreadDumpInDeadlockExceptions, String servicePrincipalName, Integer defaultFetchSize, String tlsSocketType, Integer maxQuerySizeToLog, Integer retriesAllDown, String galeraAllowedState, Boolean pool, String poolName, Integer maxPoolSize, Integer minPoolSize, Integer maxIdleTime, Boolean registerJmxPool, Integer poolValidMinDelay, Boolean useResetConnection, String serverRsaPublicKeyFile, Boolean allowPublicKeyRetrieval, String serverSslCert, String keyStore, String keyStorePassword, String keyStoreType, Boolean useReadAheadInput, Boolean cachePrepStmts, Boolean transactionReplay, String geometryDefaultType, String restrictedAuth, Properties nonMappedOptions) throws SQLException - Throws:
SQLException
-
-
Method Details
-
acceptsUrl
Tell if mariadb driver accept url string. (Correspond to interface java.jdbc.Driver.acceptsURL() method)- Parameters:
url
- url String- Returns:
- true if url string correspond.
-
parse
- Throws:
SQLException
-
parse
Parse url connection string with additional properties.- Parameters:
url
- connection stringprop
- properties- Returns:
- UrlParser instance
- Throws:
SQLException
- if parsing exception occur
-
parseInternal
Parses the connection URL in order to set the UrlParser instance with all the information provided through the URL.- Parameters:
url
- connection URLproperties
- properties- Throws:
SQLException
- if format is incorrect
-
mapPropertiesToOption
-
isSet
-
parseHaMode
-
clone
-
database
-
addresses
-
haMode
-
credentialPlugin
-
user
-
password
-
initialUrl
-
serverSslCert
-
keyStore
-
keyStorePassword
-
keyStoreType
-
enabledSslProtocolSuites
-
socketFactory
-
connectTimeout
public int connectTimeout() -
connectTimeout
-
pipe
-
localSocket
-
tcpKeepAlive
public boolean tcpKeepAlive() -
tcpKeepIdle
public int tcpKeepIdle() -
tcpKeepCount
public int tcpKeepCount() -
tcpKeepInterval
public int tcpKeepInterval() -
tcpAbortiveClose
public boolean tcpAbortiveClose() -
localSocketAddress
-
socketTimeout
public int socketTimeout() -
allowMultiQueries
public boolean allowMultiQueries() -
allowLocalInfile
public boolean allowLocalInfile() -
useCompression
public boolean useCompression() -
blankTableNameMeta
public boolean blankTableNameMeta() -
sslMode
-
transactionIsolation
-
enabledSslCipherSuites
-
sessionVariables
-
tinyInt1isBit
public boolean tinyInt1isBit() -
yearIsDateType
public boolean yearIsDateType() -
timezone
-
dumpQueriesOnException
public boolean dumpQueriesOnException() -
prepStmtCacheSize
public int prepStmtCacheSize() -
useAffectedRows
public boolean useAffectedRows() -
useServerPrepStmts
public boolean useServerPrepStmts() -
connectionAttributes
-
useBulkStmts
public boolean useBulkStmts() -
autocommit
public boolean autocommit() -
useMysqlMetadata
public boolean useMysqlMetadata() -
includeInnodbStatusInDeadlockExceptions
public boolean includeInnodbStatusInDeadlockExceptions() -
includeThreadDumpInDeadlockExceptions
public boolean includeThreadDumpInDeadlockExceptions() -
servicePrincipalName
-
defaultFetchSize
public int defaultFetchSize() -
nonMappedOptions
-
tlsSocketType
-
maxQuerySizeToLog
public int maxQuerySizeToLog() -
retriesAllDown
public int retriesAllDown() -
galeraAllowedState
-
pool
public boolean pool() -
poolName
-
maxPoolSize
public int maxPoolSize() -
minPoolSize
public int minPoolSize() -
maxIdleTime
public int maxIdleTime() -
registerJmxPool
public boolean registerJmxPool() -
poolValidMinDelay
public int poolValidMinDelay() -
useResetConnection
public boolean useResetConnection() -
serverRsaPublicKeyFile
-
allowPublicKeyRetrieval
public boolean allowPublicKeyRetrieval() -
useReadAheadInput
public boolean useReadAheadInput() -
cachePrepStmts
public boolean cachePrepStmts() -
transactionReplay
public boolean transactionReplay() -
geometryDefaultType
-
restrictedAuth
-
codecs
-
toString
ToString implementation. -
equals
-
buildUrl
-
loadCodecs
private void loadCodecs() -
hashCode
public int hashCode() -
nullOrEmpty
-