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 ClassesModifier and TypeClassDescriptionstatic final classA builder forConfigurationinstances.private static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<HostAddress> private booleanprivate booleanprivate booleanprivate Booleanprivate booleanprivate booleanprivate static Codec<?>[]private booleanprivate static final Stringprivate Codec<?>[]private Stringprivate Stringprivate Stringprivate intprivate booleanprivate CredentialPluginprivate Stringprivate intprivate booleanprivate booleanprivate booleanprivate Stringprivate Stringprivate booleanprivate booleanprivate Booleanprivate Stringprivate Stringprivate HaModeprivate booleanprivate booleanprivate Stringprivate Stringprivate booleanprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate static final Loggerprivate intprivate Integerprivate intprivate intprivate intprivate MetaExportedKeysprivate intprivate Propertiesprivate booleanprivate booleanprivate Stringprivate booleanprivate Booleanprivate booleanprivate Stringprivate booleanprivate Stringprivate intprivate intprivate booleanprivate booleanprivate booleanprivate booleanprivate Stringprivate intprivate booleanprivate booleanprivate static final Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate intprivate SslModeprivate booleanprivate booleanprivate intprivate intprivate intprivate Stringprivate booleanprivate Stringprivate TransactionIsolationprivate booleanprivate intprivate booleanprivate Stringprivate Stringprivate Stringprivate booleanprivate booleanprivate booleanprivate CatalogTermprivate booleanprivate booleanprivate booleanprivate booleanprivate Stringprivate booleanprivate booleanprivate booleanprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanacceptsUrl(String url) Tell if mariadb driver accept url string.addressesbooleanpermits LOAD LOCAL INFILE commandsbooleanpermit using multi queries commandbooleanpermit mysql authentication to retrieve server certificateprivate static voidprivate static voidappendBooleanParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) private static voidappendCatalogTermParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) private static voidappendConfigurationParameters(StringBuilder sb, Configuration conf, boolean hideSensitive) private static voidappendCredentialPluginParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) private static voidappendDatabase(StringBuilder sb, Configuration conf) private static voidappendDefaultOptions(StringBuilder sb, Configuration conf, Configuration defaultConf) private static voidappendDefaultParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) private static voidappendFieldParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf, boolean hideSensitive) private static voidappendHaModeField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) private static voidappendHaModeIfPresent(StringBuilder sb, Configuration conf) private static voidappendHostAddress(StringBuilder sb, Configuration conf, HostAddress hostAddress, int index) private static voidappendHostAddresses(StringBuilder sb, Configuration conf) private static voidappendIntParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) private static voidappendListField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) private static voidappendNonDefaultOptions(StringBuilder sb, Configuration conf, Configuration defaultConf) private static voidappendNullField(Field field, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) private static voidappendPropertiesParameter(Configuration.ParameterAppender appender, Properties props, boolean hideSensitive) private static voidappendSimpleField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) private static voidappendStringParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) private static voidappendUnknownOptions(StringBuilder sb, Configuration conf) Force session autocommit on connection creationbooleanforce returning blank table metadata (for old oracle compatibility)protected static StringbuildUrl(Configuration conf, boolean hideSensitive) Builds a JDBC URL from the provided configuration.booleanCache prepared statement result.Clone configuration with another user/passwordCodec<?>[]codecs()datatype Encoder/decoder listprivate voidConnections attributesget connectionCollationSet connectionTimeZoneintsocket connect timeoutbooleancreate database if not existcredential plugin to usedatabase()Connection default databaseintresult-set streaming default fetch sizebooleanDisable pipeline.booleanOn connection creation, indicate behavior when password is expired.booleanMust query by logged on exception.autorized cipher list.permitted ssl protocol list (comma separated)booleanprivate static StringextractDatabase(String additionalParameters, int optIndex) booleanIndicate if keyStore option is not set to use keystore system property like "javax.net.ssl.keyStore"booleanIndicate if system default truststore implementation can be usedforceConnectionTimeZoneToSession must connection timezone be forcedGalera comma separated allowed stategeometry default decoding implementationprivate static StringgetRealKey(String key) haMode()High availability modeprivate static voidhandleBooleanField(Configuration.Builder builder, Field field, Object value, Object originalKey) private static voidhandleIntegerField(Configuration.Builder builder, Field field, Object value, Object originalKey) private static voidhandleLegacySslSettings(Configuration.Builder builder, Properties nonMappedOptions) private static voidhandleStringField(Configuration.Builder builder, Field field, Object value) inthashCode()booleanbooleanOn deadlock exception, must driver execute additional commands to show innodb status in error description.booleanOn deadlock exception, must driver display threads information on error description.private voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidinitializeSslConfig(Configuration.Builder builder) private voidprivate voidprotected StringConfiguration generated URL depending on current configuration option.initSql()Execute initial command when connection is establishedprivate static booleanisSensitiveOption(String key) A credential that has no dedicated field is kept in nonMappedOptions, e.g.private static booleanisSet(String key, Properties nonMappedOptions) booleanForce sql_mode to strict mode for JDBC compliancekey store alias passwordkeyStore()key storekey store passwordkey store type (to replace default javax.net.ssl.keyStoreType system property)private voidlocal socket configurationlocal socket address pathprivate static voidmapPropertiesToOption(Configuration.Builder builder, Properties properties) intMaximum number of columns the driver will accept in a result-set or prepare metadata received from the server.Maximum size (in bytes) of a packet the driver will send or receive.intMax idle timeintmax pool sizeintquery maximum size to log (query will be truncated of more than this limit)Default metadata getExportedKeys implementation.intMinimum pool sizenon standard optionsbooleanWhen enable, in DatabaseMetadata, will handle null database/schema (depending on UseCatalog=catalog/schema) as currentprivate static StringnullOrEmpty(String val) booleanForce Timestamp string representation compatible to 2.7 version Timestamp string representation will then correspond to Timestamp.toString() in place of taking field precisionstatic Configurationparse connection stringstatic Configurationparse(String url, Properties prop) Parse url connection string with additional properties.private static HaModeparseHaMode(String url, int separator) private static ConfigurationparseInternal(String url, Properties properties) Parses the connection URL in order to set the UrlParser instance with all the information provided through the URL.password()configuration passwordbooleanIndicate if Statement/PreparedStatement.executeQuery for command that produce no result will return an exception or just an empty result-setmust client redirect when requiredbooleanWhen enabled, ensure that for XA operation to use the same connectionpipe()Pipe pathbooleanpool()Create poolpoolName()pool nameintPool mininum validation delay.intPrepare statement cache size.booleanMust timezone change preserve instantsprivate static voidprocessDatabaseAndParameters(String additionalParameters, Configuration.Builder builder, Properties properties) private static voidprocessField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) private static voidprocessFields(Configuration conf, Configuration defaultConf, StringBuilder defaultOpts, StringBuilder diffOpts) private static voidprocessProperties(Configuration.Builder builder, Properties properties, Properties nonMappedOptions) private static voidprocessProperty(Configuration.Builder builder, String realKey, Object propertyValue, Object originalKey, Properties nonMappedOptions) private static voidprocessUrlParameters(String urlParameters, Properties properties) booleanWhether LocalDateTime is handled as a pure zoneless wall-clock value (default true), matching SQL DATETIME semantics.booleanWhen enabled (the default),Connection.setReadOnly(boolean)on a single-host connection propagates the read-only state to the server by issuingSET SESSION TRANSACTION READ ONLY/READ WRITE, for servers >= 5.6.5.booleanregister pool information to JMXRestrict authentication plugin to comma separated plugin listintretry the maximum retry number of attempts to reconnect after a failover.booleanReturns multi-values generated ids.booleanServer RSA public key file for caching_sha2_password authenticationserver ssl certificate (file path / certificat content)Service principal name (GSSAPI option)coma separated Session variable listprivate static voidsetFieldValue(Configuration.Builder builder, Field field, Object propertyValue, Object originalKey) private static booleanshouldUseSimpleHostFormat(Configuration conf, HostAddress hostAddress, int index) private static intskipComplexAddresses(String urlSecondPart) Socket factory class nameintsocket timeoutsslMode()SSl modebooleanclose using TCP abortive close (RST TCP packet, in place or FIN packet)booleansocket tcp keep aliveintsocket tcp keep count (java 11+ only)intsocket tcp keep idle (java 11+ only)intsocket tcp keep interval (java 11+ only)timezone()Set timezonebooleanMust tinyint(1) be considered as BitTLS socket typeCreate a Builder from current configuration.static StringPermit to have string information on how string is parsed.toString()ToString implementation.Default transaction isolationbooleanimplements transaction replay failoverinttransaction replay maximum number of saved command.booleanMust tinyint(1) be considered as Boolean or Bittrust storetrust store passwordtrust store type (to replace default javax.net.ssl.keyStoreType system property)booleanUse affected rowbooleanUse server COM_STMT_BULK for batching.booleanUse server COM_STMT_BULK for batching inserts.Indicating using Catalog or SchemabooleanEnable compression if server has compression capabilitybooleanWhetherConnection.cancelCurrentQuery()should reuse the current socket IP instead of the original hostname when opening the kill connection.booleanuse local state to avoid unnecessary queries.booleanForce returning MySQL metadata informationuser()configuration userbooleanRead all data from socket in advancebooleanMust connection returned to pool be RESETbooleanUse server prepared statement.booleanmust uuid fields return as String and not java.util.UUIDprivate voidprivate voidprivate static voidvalidateUrlFormat(String url) booleanMust year be return by default as Date in result-set
-
Field Details
-
logger
-
EXCLUDED_FIELDS
-
SECURE_FIELDS
-
PROPERTIES_TO_SKIP
-
SENSITIVE_FIELDS
-
CATALOG_TERM
- See Also:
-
SCHEMA_TERM
- See Also:
-
cachedCodecs
-
user
-
password
-
database
-
addresses
-
haMode
-
initialUrl
-
nonMappedOptions
-
timezone
-
connectionCollation
-
connectionTimeZone
-
forceConnectionTimeZoneToSession
-
preserveInstants
private boolean preserveInstants -
pureLocalDateTime
private boolean pureLocalDateTime -
autocommit
-
useMysqlMetadata
private boolean useMysqlMetadata -
nullDatabaseMeansCurrent
private boolean nullDatabaseMeansCurrent -
useCatalogTerm
-
createDatabaseIfNotExist
private boolean createDatabaseIfNotExist -
useLocalSessionState
private boolean useLocalSessionState -
readOnlyPropagatesToServer
private boolean readOnlyPropagatesToServer -
returnMultiValuesGeneratedIds
private boolean returnMultiValuesGeneratedIds -
jdbcCompliantTruncation
private boolean jdbcCompliantTruncation -
oldModeNoPrecisionTimestamp
private boolean oldModeNoPrecisionTimestamp -
permitRedirect
-
transactionIsolation
-
defaultFetchSize
private int defaultFetchSize -
maxQuerySizeToLog
private int maxQuerySizeToLog -
maxAllowedPacket
-
maxAllowedColumns
private int maxAllowedColumns -
geometryDefaultType
-
restrictedAuth
-
initSql
-
pinGlobalTxToPhysicalConnection
private boolean pinGlobalTxToPhysicalConnection -
permitNoResults
private boolean permitNoResults -
cacheCodecs
private boolean cacheCodecs -
metaExportedKeys
-
socketFactory
-
connectTimeout
private int connectTimeout -
pipe
-
localSocket
-
uuidAsString
private boolean uuidAsString -
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
-
trustStore
-
keyStorePassword
-
trustStorePassword
-
keyPassword
-
keyStoreType
-
trustStoreType
-
enabledSslCipherSuites
-
enabledSslProtocolSuites
-
fallbackToSystemKeyStore
private boolean fallbackToSystemKeyStore -
fallbackToSystemTrustStore
private boolean fallbackToSystemTrustStore -
allowMultiQueries
private boolean allowMultiQueries -
allowLocalInfile
private boolean allowLocalInfile -
rewriteBatchedStatements
private boolean rewriteBatchedStatements -
useCompression
private boolean useCompression -
useAffectedRows
private boolean useAffectedRows -
useBulkStmts
private boolean useBulkStmts -
useBulkStmtsForInserts
private boolean useBulkStmtsForInserts -
disablePipeline
private boolean disablePipeline -
cachePrepStmts
private boolean cachePrepStmts -
prepStmtCacheSize
private int prepStmtCacheSize -
useServerPrepStmts
private boolean useServerPrepStmts -
credentialType
-
sessionVariables
-
connectionAttributes
-
servicePrincipalName
-
disconnectOnExpiredPasswords
private boolean disconnectOnExpiredPasswords -
blankTableNameMeta
private boolean blankTableNameMeta -
tinyInt1isBit
private boolean tinyInt1isBit -
transformedBitIsBoolean
private boolean transformedBitIsBoolean -
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 -
transactionReplaySize
private int transactionReplaySize -
useIpForKillQuery
private boolean useIpForKillQuery -
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
-
-
Method Details
-
initializeBasicConfig
-
initializeSslConfig
-
initializeSocketConfig
-
initializeTransactionConfig
-
initializeDataTypeConfig
-
initializeTimezoneConfig
-
initializeQueryConfig
-
initializeBulkConfig
-
initializePipelineConfig
-
initializeDatabaseConfig
-
initializeExceptionConfig
-
initializePoolConfig
-
initializeSecurityConfig
-
initializeAdditionalConfig
-
configureHosts
private void configureHosts() -
validateConfiguration
private void validateConfiguration() -
validateIntegerFields
private void validateIntegerFields() -
toBuilder
Create a Builder from current configuration. Since configuration data are final, this permit to change configuration, creating another object.- Returns:
- builder
-
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
parse connection string- Parameters:
url- connection string- Returns:
- configuration resulting object
- Throws:
SQLException- if not supported driver or wrong connection string format.
-
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
-
validateUrlFormat
-
skipComplexAddresses
-
processDatabaseAndParameters
private static void processDatabaseAndParameters(String additionalParameters, Configuration.Builder builder, Properties properties) -
extractDatabase
-
processUrlParameters
-
mapPropertiesToOption
-
processProperties
private static void processProperties(Configuration.Builder builder, Properties properties, Properties nonMappedOptions) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
getRealKey
-
processProperty
private static void processProperty(Configuration.Builder builder, String realKey, Object propertyValue, Object originalKey, Properties nonMappedOptions) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
setFieldValue
private static void setFieldValue(Configuration.Builder builder, Field field, Object propertyValue, Object originalKey) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
handleStringField
private static void handleStringField(Configuration.Builder builder, Field field, Object value) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
handleBooleanField
private static void handleBooleanField(Configuration.Builder builder, Field field, Object value, Object originalKey) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
handleIntegerField
private static void handleIntegerField(Configuration.Builder builder, Field field, Object value, Object originalKey) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
handleLegacySslSettings
private static void handleLegacySslSettings(Configuration.Builder builder, Properties nonMappedOptions) -
isSet
-
parseHaMode
-
toConf
Permit to have string information on how string is parsed. example : Configuration.toConf("jdbc:mariadb://localhost/test") will return a String containing:Configuration: * resulting Url : jdbc:mariadb://localhost/test Unknown options : None Non default options : * database : test default options : * user : null ...- Parameters:
url- url string- Returns:
- string describing the configuration parsed from url
- Throws:
SQLException- if parsing fails
-
appendBasicConfiguration
-
appendUnknownOptions
-
appendNonDefaultOptions
private static void appendNonDefaultOptions(StringBuilder sb, Configuration conf, Configuration defaultConf) -
appendDefaultOptions
private static void appendDefaultOptions(StringBuilder sb, Configuration conf, Configuration defaultConf) -
processFields
private static void processFields(Configuration conf, Configuration defaultConf, StringBuilder defaultOpts, StringBuilder diffOpts) throws IllegalAccessException - Throws:
IllegalAccessException
-
processField
private static void processField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) -
appendNullField
private static void appendNullField(Field field, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) -
appendHaModeField
private static void appendHaModeField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) -
appendSimpleField
private static void appendSimpleField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) -
appendListField
private static void appendListField(Field field, Object fieldValue, Object defaultValue, StringBuilder defaultOpts, StringBuilder diffOpts) -
buildUrl
Builds a JDBC URL from the provided configuration.Redaction is a rendering choice, not a property of the url: a redacted url cannot be parsed back into a working configuration, so it must only be used for display. The configuration's own url is built unredacted, otherwise credentials that have no dedicated field would vanish from the value
equals(Object)compares, and two configurations differing only by an AWS IAMsecretKeyor a PAMpassword2would share a connection pool.- Parameters:
conf- Current configurationhideSensitive- replace every credential value by***- Returns:
- Complete JDBC URL string
-
appendHostAddresses
-
appendHostAddress
private static void appendHostAddress(StringBuilder sb, Configuration conf, HostAddress hostAddress, int index) -
shouldUseSimpleHostFormat
private static boolean shouldUseSimpleHostFormat(Configuration conf, HostAddress hostAddress, int index) -
appendDatabase
-
appendHaModeIfPresent
-
appendConfigurationParameters
private static void appendConfigurationParameters(StringBuilder sb, Configuration conf, boolean hideSensitive) -
appendFieldParameter
private static void appendFieldParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf, boolean hideSensitive) throws IllegalAccessException - Throws:
IllegalAccessException
-
appendStringParameter
private static void appendStringParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) throws IllegalAccessException - Throws:
IllegalAccessException
-
appendBooleanParameter
private static void appendBooleanParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) throws IllegalAccessException - Throws:
IllegalAccessException
-
appendIntParameter
private static void appendIntParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) -
appendPropertiesParameter
private static void appendPropertiesParameter(Configuration.ParameterAppender appender, Properties props, boolean hideSensitive) -
isSensitiveOption
A credential that has no dedicated field is kept in nonMappedOptions, e.g. the AWS IAMsecretKeyor the PAMpassword2/password3steps. Mask those values the same waySECURE_FIELDSmasks the declared password fields, so a serialized url does not expose them.- Parameters:
key- option name- Returns:
- true if the option value must be redacted
-
appendCatalogTermParameter
private static void appendCatalogTermParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) throws IllegalAccessException - Throws:
IllegalAccessException
-
appendCredentialPluginParameter
private static void appendCredentialPluginParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) throws IllegalAccessException - Throws:
IllegalAccessException
-
appendDefaultParameter
private static void appendDefaultParameter(Configuration.ParameterAppender appender, Field field, Object value, Configuration defaultConf) throws IllegalAccessException - Throws:
IllegalAccessException
-
nullOrEmpty
-
clone
Clone configuration with another user/password- Parameters:
username- new usernamepassword- new password- Returns:
- new cloned configuration object
-
havePrimaryHostOnly
public boolean havePrimaryHostOnly() -
database
-
addresses
-
haMode
-
credentialPlugin
credential plugin to use- Returns:
- credential plugin to use, null of none
-
user
-
password
-
initialUrl
Configuration generated URL depending on current configuration option.- Returns:
- generated url
-
serverSslCert
server ssl certificate (file path / certificat content)- Returns:
- server ssl certificate
-
keyStore
-
trustStore
-
keyStorePassword
-
trustStorePassword
-
keyPassword
-
keyStoreType
key store type (to replace default javax.net.ssl.keyStoreType system property)- Returns:
- key store type
-
trustStoreType
trust store type (to replace default javax.net.ssl.keyStoreType system property)- Returns:
- trust store type
-
enabledSslProtocolSuites
permitted ssl protocol list (comma separated)- Returns:
- enabled ssl protocol list
-
credentialType
-
fallbackToSystemKeyStore
public boolean fallbackToSystemKeyStore()Indicate if keyStore option is not set to use keystore system property like "javax.net.ssl.keyStore"- Returns:
- true if can use keystore system property
-
fallbackToSystemTrustStore
public boolean fallbackToSystemTrustStore()Indicate if system default truststore implementation can be used- Returns:
- true if system default truststore implementation can be used
-
socketFactory
-
connectTimeout
public int connectTimeout()socket connect timeout- Returns:
- connect timeout
-
pipe
-
localSocket
-
tcpKeepAlive
public boolean tcpKeepAlive()socket tcp keep alive- Returns:
- socket tcp keep alive value
-
uuidAsString
public boolean uuidAsString()must uuid fields return as String and not java.util.UUID- Returns:
- must UUID return as String and not uuid
-
tcpKeepIdle
public int tcpKeepIdle()socket tcp keep idle (java 11+ only)- Returns:
- socket tcp keep idle
-
tcpKeepCount
public int tcpKeepCount()socket tcp keep count (java 11+ only)- Returns:
- socket tcp keep count
-
tcpKeepInterval
public int tcpKeepInterval()socket tcp keep interval (java 11+ only)- Returns:
- socket tcp keep interval
-
tcpAbortiveClose
public boolean tcpAbortiveClose()close using TCP abortive close (RST TCP packet, in place or FIN packet)- Returns:
- close using TCP abortive close
-
localSocketAddress
-
socketTimeout
public int socketTimeout()socket timeout- Returns:
- socket timeout
-
allowMultiQueries
public boolean allowMultiQueries()permit using multi queries command- Returns:
- permit using multi queries command
-
allowLocalInfile
public boolean allowLocalInfile()permits LOAD LOCAL INFILE commands- Returns:
- allow LOAD LOCAL INFILE
-
useCompression
public boolean useCompression()Enable compression if server has compression capability- Returns:
- use compression
-
blankTableNameMeta
public boolean blankTableNameMeta()force returning blank table metadata (for old oracle compatibility)- Returns:
- metadata table return blank
-
disconnectOnExpiredPasswords
public boolean disconnectOnExpiredPasswords()On connection creation, indicate behavior when password is expired. When true (default) throw an expired password error When false, connection succeed in "sandbox" mode, only queries related to password change are allowed- Returns:
- must connection fails on expired password
-
sslMode
-
transactionIsolation
Default transaction isolation- Returns:
- default transaction isolation.
-
metaExportedKeys
Default metadata getExportedKeys implementation.- Returns:
- default implementation
-
enabledSslCipherSuites
-
sessionVariables
-
tinyInt1isBit
public boolean tinyInt1isBit()Must tinyint(1) be considered as Bit- Returns:
- true if tinyint(1) must be considered as Bit
-
transformedBitIsBoolean
public boolean transformedBitIsBoolean()Must tinyint(1) be considered as Boolean or Bit- Returns:
- true if tinyint(1) must be considered as Boolean
-
yearIsDateType
public boolean yearIsDateType()Must year be return by default as Date in result-set- Returns:
- year is Date type
-
timezone
-
connectionTimeZone
-
connectionCollation
-
forceConnectionTimeZoneToSession
forceConnectionTimeZoneToSession must connection timezone be forced- Returns:
- forceConnectionTimeZoneToSession
-
preserveInstants
public boolean preserveInstants()Must timezone change preserve instants- Returns:
- true if instants must be preserved
-
pureLocalDateTime
public boolean pureLocalDateTime()Whether LocalDateTime is handled as a pure zoneless wall-clock value (default true), matching SQL DATETIME semantics. When set tofalse,preserveInstantsalso converts LocalDateTime between the connection time zone and the JVM default.- Returns:
- true if LocalDateTime is treated as a pure zoneless value
-
dumpQueriesOnException
public boolean dumpQueriesOnException()Must query by logged on exception.- Returns:
- dump queries on exception
-
prepStmtCacheSize
public int prepStmtCacheSize()Prepare statement cache size.- Returns:
- Prepare statement cache size
-
useAffectedRows
public boolean useAffectedRows()Use affected row- Returns:
- use affected rows
-
rewriteBatchedStatements
public boolean rewriteBatchedStatements() -
useServerPrepStmts
public boolean useServerPrepStmts()Use server prepared statement. IF false, using client prepared statement.- Returns:
- use server prepared statement
-
connectionAttributes
-
useBulkStmts
public boolean useBulkStmts()Use server COM_STMT_BULK for batching.- Returns:
- use server bulk command.
-
useBulkStmtsForInserts
public boolean useBulkStmtsForInserts()Use server COM_STMT_BULK for batching inserts. if useBulkStmts is enabled, useBulkStmtsForInserts will be as well- Returns:
- use server bulk command for inserts
-
disablePipeline
public boolean disablePipeline()Disable pipeline.- Returns:
- is pipeline disabled.
-
autocommit
Force session autocommit on connection creation- Returns:
- autocommit forced value
-
useMysqlMetadata
public boolean useMysqlMetadata()Force returning MySQL metadata information- Returns:
- force returning MySQL in metadata
-
nullDatabaseMeansCurrent
public boolean nullDatabaseMeansCurrent()When enable, in DatabaseMetadata, will handle null database/schema (depending on UseCatalog=catalog/schema) as current- Returns:
- must null value be considered as current catalog/schema
-
useCatalogTerm
Indicating using Catalog or Schema- Returns:
- Indicating using Catalog or Schema
-
createDatabaseIfNotExist
public boolean createDatabaseIfNotExist()create database if not exist- Returns:
- create database if not exist
-
useLocalSessionState
public boolean useLocalSessionState()use local state to avoid unnecessary queries. This means application must use JDBC dedicated methods, like connection.setTransactionIsolation and never queries like "SET SESSION TRANSACTION ISOLATION LEVEL X" directly- Returns:
- can use local state
-
readOnlyPropagatesToServer
public boolean readOnlyPropagatesToServer()When enabled (the default),Connection.setReadOnly(boolean)on a single-host connection propagates the read-only state to the server by issuingSET SESSION TRANSACTION READ ONLY/READ WRITE, for servers >= 5.6.5. This lets the server (and engines that can use it) reject DML on a read-only connection and take an optimistic read-only transaction path. Multi-host replica connections are already put in read-only mode at connection time, so this option does not change their behavior. When disabled,setReadOnly()sends no statement on a single-host connection.- Returns:
- true if
setReadOnly()propagates the read-only state to the server
-
returnMultiValuesGeneratedIds
public boolean returnMultiValuesGeneratedIds()Returns multi-values generated ids. For mariadb 2.x connector compatibility- Returns:
- must returns multi-values generated ids.
-
jdbcCompliantTruncation
public boolean jdbcCompliantTruncation()Force sql_mode to strict mode for JDBC compliance- Returns:
- must force jdbc compliance
-
oldModeNoPrecisionTimestamp
public boolean oldModeNoPrecisionTimestamp()Force Timestamp string representation compatible to 2.7 version Timestamp string representation will then correspond to Timestamp.toString() in place of taking field precision- Returns:
- force 2.7 timestamp to string behavior
-
permitRedirect
must client redirect when required- Returns:
- must client redirect when required
-
pinGlobalTxToPhysicalConnection
public boolean pinGlobalTxToPhysicalConnection()When enabled, ensure that for XA operation to use the same connection- Returns:
- pinGlobalTxToPhysicalConnection
-
permitNoResults
public boolean permitNoResults()Indicate if Statement/PreparedStatement.executeQuery for command that produce no result will return an exception or just an empty result-setWhen enabled, command not returning no data will end returning an empty result-set When disabled, command not returning no data will end throwing an exception
- Returns:
- permitNoResults
-
includeInnodbStatusInDeadlockExceptions
public boolean includeInnodbStatusInDeadlockExceptions()On deadlock exception, must driver execute additional commands to show innodb status in error description.- Returns:
- includeInnodbStatusInDeadlockExceptions
-
includeThreadDumpInDeadlockExceptions
public boolean includeThreadDumpInDeadlockExceptions()On deadlock exception, must driver display threads information on error description.- Returns:
- include Thread Dump In Deadlock Exceptions
-
servicePrincipalName
Service principal name (GSSAPI option)- Returns:
- service principal name
-
defaultFetchSize
public int defaultFetchSize()result-set streaming default fetch size- Returns:
- Default fetch size.
-
nonMappedOptions
-
tlsSocketType
-
maxQuerySizeToLog
public int maxQuerySizeToLog()query maximum size to log (query will be truncated of more than this limit)- Returns:
- max query log size
-
maxAllowedPacket
Maximum size (in bytes) of a packet the driver will send or receive. When set, this value is advertised to the server during the handshake, used to reject a command whose size would exceed it, and used to reject an oversized packet received from the server. Whennull, no client-side limit is enforced on the send side, and the receive side falls back to a server-independent heap-relative ceiling (a quarter of the JVM max heap, clamped between 16Mb and 1Gb).- Returns:
- max_allowed_packet value
-
maxAllowedColumns
public int maxAllowedColumns()Maximum number of columns the driver will accept in a result-set or prepare metadata received from the server. Reading column metadata allocates memory proportional to the announced column count, so a malicious proxy announcing a huge count could exhaust client memory. When the server announces more columns than this limit, the command is interrupted with an error. Defaults to 65535.- Returns:
- maximum allowed number of columns
-
retriesAllDown
public int retriesAllDown()retry the maximum retry number of attempts to reconnect after a failover.- Returns:
- the maximum retry number of attempts to reconnect after a failover.
-
galeraAllowedState
Galera comma separated allowed state- Returns:
- galera allowed state
-
pool
public boolean pool()Create pool- Returns:
- create pool if don't exists
-
poolName
-
maxPoolSize
public int maxPoolSize()max pool size- Returns:
- maximum pool size
-
minPoolSize
public int minPoolSize()Minimum pool size- Returns:
- minimum pool size
-
maxIdleTime
public int maxIdleTime()Max idle time- Returns:
- pool max idle time.
-
registerJmxPool
public boolean registerJmxPool()register pool information to JMX- Returns:
- register pool to JMX
-
poolValidMinDelay
public int poolValidMinDelay()Pool mininum validation delay.- Returns:
- pool validation delay
-
useResetConnection
public boolean useResetConnection()Must connection returned to pool be RESET- Returns:
- use RESET on connection
-
serverRsaPublicKeyFile
Server RSA public key file for caching_sha2_password authentication- Returns:
- server key file
-
allowPublicKeyRetrieval
public boolean allowPublicKeyRetrieval()permit mysql authentication to retrieve server certificate- Returns:
- is driver allowed to retrieve server certificate from server
-
useReadAheadInput
public boolean useReadAheadInput()Read all data from socket in advance- Returns:
- use read ahead buffer implementation
-
cachePrepStmts
public boolean cachePrepStmts()Cache prepared statement result.- Returns:
- cache prepare results
-
transactionReplay
public boolean transactionReplay()implements transaction replay failover- Returns:
- true if transaction must be replayed on failover.
-
transactionReplaySize
public int transactionReplaySize()transaction replay maximum number of saved command.- Returns:
- transaction replay buffer size.
-
useIpForKillQuery
public boolean useIpForKillQuery()WhetherConnection.cancelCurrentQuery()should reuse the current socket IP instead of the original hostname when opening the kill connection. Defaultfalse.- Returns:
- true to reuse the socket IP, false to keep the original hostname.
-
geometryDefaultType
geometry default decoding implementation- Returns:
- geometry default type
-
restrictedAuth
Restrict authentication plugin to comma separated plugin list- Returns:
- authorized authentication list
-
initSql
Execute initial command when connection is established- Returns:
- initial SQL command
-
codecs
-
toString
-
equals
-
loadCodecs
private void loadCodecs() -
hashCode
-