Package org.mariadb.jdbc

## Class Configuration.Builder

- java.lang.Object
- - org.mariadb.jdbc.Configuration.Builder

All Implemented Interfaces:
  `Cloneable`

Enclosing class:
  Configuration

    public static final class Configuration.Builder
    extends Object
    implements Cloneable

A builder for `Configuration` instances.

### Constructor Summary

Constructors
`Builder()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Configuration.Builder` `addHost​(String host, int port)` Add Host to possible addresses to connect
`Configuration.Builder` `addHost​(String host, int port, boolean master)` Add Host to possible addresses to connect
`Configuration.Builder` `addHost​(String host, int port, boolean master, String sslMode)` Add Host to possible addresses to connect
`Configuration.Builder` `addHost​(String host, int port, String sslMode)` Add Host to possible addresses to connect
`Configuration.Builder` `addLocalSocketHost​(String localSocket)` Add a unix socket host
`Configuration.Builder` `addPipeHost​(String pipe)` Add a windows pipe host
`Configuration.Builder` `addresses​(List<HostAddress> hostAddress)` add host addresses
`Configuration.Builder` `addresses​(HostAddress... hostAddress)` add host addresses
`Configuration.Builder` `allowLocalInfile​(Boolean allowLocalInfile)` Indicate if LOAD DATA LOCAL INFILE are permitted.
`Configuration.Builder` `allowMultiQueries​(Boolean allowMultiQueries)` Indicate that multi-queries are allowed.
`Configuration.Builder` `allowPublicKeyRetrieval​(Boolean allowPublicKeyRetrieval)` Allow RSA server file retrieval from MySQL server
`Configuration.Builder` `autocommit​(Boolean autocommit)` Permit to force autocommit connection value
`Configuration.Builder` `blankTableNameMeta​(Boolean blankTableNameMeta)` Set blank table name for metadata (old oracle compatibility)
`Configuration` `build()` Build a configuration
`Configuration.Builder` `cachePrepStmts​(Boolean cachePrepStmts)` Cache server prepare result
`Configuration.Builder` `connectionAttributes​(String connectionAttributes)` Additional connection attributes to identify connection
`Configuration.Builder` `connectionCollation​(String connectionCollation)` indicate what utf8mb4 collation to use.
`Configuration.Builder` `connectionTimeZone​(String connectionTimeZone)` indicate what timestamp timezone to use in exchanges with server possible value are LOCAL|SERVER|user-defined time zone
`Configuration.Builder` `connectTimeout​(Integer connectTimeout)` Indicate connect timeout value, in milliseconds, or zero for no timeout.
`Configuration.Builder` `createDatabaseIfNotExist​(Boolean createDatabaseIfNotExist)` Create database if not exist.
`Configuration.Builder` `credentialType​(String credentialType)` set credential plugin type
`Configuration.Builder` `database​(String database)` Set default database
`Configuration.Builder` `defaultFetchSize​(Integer defaultFetchSize)` Set default fetch size
`Configuration.Builder` `disablePipeline​(Boolean disablePipeline)` Disable pipeline
`Configuration.Builder` `dumpQueriesOnException​(Boolean dumpQueriesOnException)` Must queries be dump on exception stracktrace.
`Configuration.Builder` `enabledSslCipherSuites​(String enabledSslCipherSuites)` set possible cipher list (comma separated), not using default java cipher list
`Configuration.Builder` `enabledSslProtocolSuites​(String enabledSslProtocolSuites)` Set ssl protocol list to user (comma separated)
`Configuration.Builder` `fallbackToSystemKeyStore​(Boolean fallbackToSystemKeyStore)` Indicate if keystore system properties can be used.
`Configuration.Builder` `fallbackToSystemTrustStore​(Boolean fallbackToSystemTrustStore)` Indicate if system default truststore can be used.
`Configuration.Builder` `forceConnectionTimeZoneToSession​(Boolean forceConnectionTimeZoneToSession)` Indicate if connectionTimeZone must be forced to session
`Configuration.Builder` `galeraAllowedState​(String galeraAllowedState)` Indicate galera allowed state (comma separated), permitting to validate if galera node is synchronized
`Configuration.Builder` `geometryDefaultType​(String geometryDefault)` Indicate what default Object type Geometry a resultset.getObject must return.
`Configuration.Builder` `haMode​(HaMode haMode)` Set failover High-availability mode
`Configuration.Builder` `includeInnodbStatusInDeadlockExceptions​(Boolean includeInnodbStatusInDeadlockExceptions)` On dead-lock exception must add innodb status in exception error message.
`Configuration.Builder` `includeThreadDumpInDeadlockExceptions​(Boolean includeThreadDumpInDeadlockExceptions)` Dead-lock error will contain threads information
`Configuration.Builder` `initSql​(String initSql)` permit to execute an SQL command on connection creation
`Configuration.Builder` `jdbcCompliantTruncation​(Boolean jdbcCompliantTruncation)` indicate if connector must force sql_mode strict mode for jdbc compliance
`Configuration.Builder` `keyPassword​(String keyPassword)` Client keystore alias password
`Configuration.Builder` `keyStore​(String 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)
`Configuration.Builder` `keyStorePassword​(String keyStorePassword)` Client keystore password
`Configuration.Builder` `keyStoreType​(String keyStoreType)` Key store type
`Configuration.Builder` `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).
`Configuration.Builder` `localSocketAddress​(String localSocketAddress)` Indicate Hostname or IP address to bind the connection socket to a local (UNIX domain) socket.
`Configuration.Builder` `maxAllowedPacket​(Integer maxAllowedPacket)` Indicate to driver server max_allowed_packet.
`Configuration.Builder` `maxIdleTime​(Integer maxIdleTime)` Set the maximum idle time of a connection indicating that connection must be released
`Configuration.Builder` `maxPoolSize​(Integer maxPoolSize)` Set the limit number of connection in pool.
`Configuration.Builder` `maxQuerySizeToLog​(Integer maxQuerySizeToLog)` Set the log size limit for query
`Configuration.Builder` `minPoolSize​(Integer minPoolSize)` Minimum pool size.
`Configuration.Builder` `nullDatabaseMeansCurrent​(Boolean nullDatabaseMeansCurrent)` Permit indicating in DatabaseMetadata if null value must be considered current schema/catalog
`Configuration.Builder` `password​(String password)` User password
`Configuration.Builder` `permitRedirect​(Boolean permitRedirect)` indicate if connector must redirect connection when receiving server redirect information
`Configuration.Builder` `pinGlobalTxToPhysicalConnection​(Boolean pinGlobalTxToPhysicalConnection)` Indicate if for XA transaction, connector must reuse same connection.
`Configuration.Builder` `pipe​(String pipe)` Indicate to use windows named pipe, specify named pipe name to connect
`Configuration.Builder` `pool​(Boolean pool)` Create pool if not existing, or get a connection for the pool associate with this connection string if existing.
`Configuration.Builder` `poolName​(String poolName)` set pool name
`Configuration.Builder` `poolValidMinDelay​(Integer poolValidMinDelay)` Pool will validate connection before giving it.
`Configuration.Builder` `prepStmtCacheSize​(Integer prepStmtCacheSize)` If using server prepared statement, set LRU prepare cache size
`Configuration.Builder` `preserveInstants​(Boolean preserveInstants)` Indicate if connection must preserve instants
`Configuration.Builder` `registerJmxPool​(Boolean registerJmxPool)` Must pool register JMX information
`Configuration.Builder` `restrictedAuth​(String restrictedAuth)` restrict authentication method to secure list.
`Configuration.Builder` `retriesAllDown​(Integer retriesAllDown)` When failover occurs, how many connection attempt before throwing error when reconnecting
`Configuration.Builder` `returnMultiValuesGeneratedIds​(Boolean returnMultiValuesGeneratedIds)` indicate if connector must return multi-generated ids.
`Configuration.Builder` `serverRsaPublicKeyFile​(String serverRsaPublicKeyFile)` MySQL Authentication RSA server file, for mysql authentication
`Configuration.Builder` `serverSslCert​(String serverSslCert)` Server SSL certificate (path or file content)
`Configuration.Builder` `servicePrincipalName​(String servicePrincipalName)` set service principal name (GSSAPI)
`Configuration.Builder` `sessionVariables​(String sessionVariables)` set connection session variables (comma separated)
`Configuration.Builder` `socketFactory​(String socketFactory)` Socket factory
`Configuration.Builder` `socketTimeout​(Integer socketTimeout)` Indicate the network socket timeout (SO_TIMEOUT) in milliseconds.
`Configuration.Builder` `sslMode​(String sslMode)` Set ssl model
`Configuration.Builder` `tcpAbortiveClose​(Boolean tcpAbortiveClose)` Indicate that when connection fails, to send an RST TCP packet.
`Configuration.Builder` `tcpKeepAlive​(Boolean tcpKeepAlive)` Indicate if TCP keep-alive must be enabled.
`Configuration.Builder` `tcpKeepCount​(Integer tcpKeepCount)` Indicate TCP keep-count value (for java 11+ only).
`Configuration.Builder` `tcpKeepIdle​(Integer tcpKeepIdle)` Indicate TCP keep-idle value (for java 11+ only).
`Configuration.Builder` `tcpKeepInterval​(Integer tcpKeepInterval)` Indicate TCP keep-interval value (for java 11+ only).
`Configuration.Builder` `timezone​(String timezone)` Force timezone to use this timezone, not default java one
`Configuration.Builder` `tinyInt1isBit​(Boolean tinyInt1isBit)` TinyInt(1) to be considered as bit
`Configuration.Builder` `tlsSocketType​(String tlsSocketType)` Permit to defined default tls plugin type
`Configuration.Builder` `transactionIsolation​(String transactionIsolation)` force default transaction isolation, not using server default
`Configuration.Builder` `transactionReplay​(Boolean transactionReplay)` Must cache commands in transaction and replay transaction on failover.
`Configuration.Builder` `transactionReplaySize​(Integer transactionReplaySize)` Transaction replay cache size
`Configuration.Builder` `transformedBitIsBoolean​(Boolean transformedBitIsBoolean)` TinyInt(1) to be considered as boolean
`Configuration.Builder` `trustStore​(String trustStore)` File path of the trustStore file that contain trusted certificates (similar to java System property \"javax.net.ssl.trustStore\")
`Configuration.Builder` `trustStorePassword​(String trustStorePassword)` Client truststore password
`Configuration.Builder` `trustStoreType​(String trustStoreType)` trust store type
`Configuration.Builder` `useAffectedRows​(Boolean useAffectedRows)` Indicate server to return affected rows in place of found rows.
`Configuration.Builder` `useBulkStmts​(Boolean useBulkStmts)` Use server dedicated bulk batch command
`Configuration.Builder` `useBulkStmtsForInserts​(Boolean useBulkStmtsForInserts)` Use server dedicated bulk batch command for insert (if useBulkStmts is enabled, useBulkStmtsForInserts will be enabled as well)
`Configuration.Builder` `useCatalogTerm​(String useCatalogTerm)` "schema" and "database" are server synonymous.
`Configuration.Builder` `useCompression​(Boolean useCompression)` Indicate to compress exchanges with the database through gzip.
`Configuration.Builder` `useLocalSessionState​(Boolean useLocalSessionState)` indicate if connector can use local state to avoid unnecessary queries.
`Configuration.Builder` `useMysqlMetadata​(Boolean useMysqlMetadata)` Permit indicating to force DatabaseMetadata.getDatabaseProductName() to return `MySQL` as database type, not real database type
`Configuration.Builder` `user​(String user)` set user to authenticate to server
`Configuration.Builder` `useReadAheadInput​(Boolean useReadAheadInput)` Cache all socket available information.
`Configuration.Builder` `useResetConnection​(Boolean useResetConnection)` Indicate that connection returned to pool must be RESETed like having proper connection state.
`Configuration.Builder` `useServerPrepStmts​(Boolean useServerPrepStmts)` Indicate to use Client or Server prepared statement
`Configuration.Builder` `uuidAsString​(Boolean uuidAsString)` Indicate if UUID fields must returns as String
`Configuration.Builder` `yearIsDateType​(Boolean yearIsDateType)` Year datatype to be considered as date

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Builder

    public Builder()

### Method Detail

#### user

    public Configuration.Builder user​(String user)

set user to authenticate to server

Parameters:
  `user` - user
Returns:
  this `Configuration.Builder`

#### serverSslCert

    public Configuration.Builder serverSslCert​(String serverSslCert)

Server SSL certificate (path or file content)

Parameters:
  `serverSslCert` - set Server SSL certificate (path or file content)
Returns:
  this `Configuration.Builder`

#### keyStore

    public Configuration.Builder keyStore​(String 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`

#### trustStore

    public Configuration.Builder trustStore​(String trustStore)

File path of the trustStore file that contain trusted certificates (similar to java System property \"javax.net.ssl.trustStore\")

Parameters:
  `trustStore` - client trust store certificates
Returns:
  this `Configuration.Builder`

#### keyStorePassword

    public Configuration.Builder keyStorePassword​(String keyStorePassword)

Client keystore password

Parameters:
  `keyStorePassword` - client store password
Returns:
  this `Configuration.Builder`

#### trustStorePassword

    public Configuration.Builder trustStorePassword​(String trustStorePassword)

Client truststore password

Parameters:
  `trustStorePassword` - client truststore password
Returns:
  this `Configuration.Builder`

#### keyPassword

    public Configuration.Builder keyPassword​(String keyPassword)

Client keystore alias password

Parameters:
  `keyPassword` - client store alias password
Returns:
  this `Configuration.Builder`

#### keyStoreType

    public Configuration.Builder keyStoreType​(String keyStoreType)

Key store type

Parameters:
  `keyStoreType` - key store type
Returns:
  this `Configuration.Builder`

#### trustStoreType

    public Configuration.Builder trustStoreType​(String trustStoreType)

trust store type

Parameters:
  `trustStoreType` - trust store type
Returns:
  this `Configuration.Builder`

#### password

    public Configuration.Builder password​(String password)

User password

Parameters:
  `password` - password
Returns:
  this `Configuration.Builder`

#### enabledSslProtocolSuites

    public Configuration.Builder enabledSslProtocolSuites​(String enabledSslProtocolSuites)

Set ssl protocol list to user (comma separated)

Parameters:
  `enabledSslProtocolSuites` - set possible SSL(TLS) protocol to use
Returns:
  this `Configuration.Builder`

#### fallbackToSystemKeyStore

    public Configuration.Builder fallbackToSystemKeyStore​(Boolean fallbackToSystemKeyStore)

Indicate if keystore system properties can be used.

Parameters:
  `fallbackToSystemKeyStore` - set if keystore system properties can be used.
Returns:
  this `Configuration.Builder`

#### fallbackToSystemTrustStore

    public Configuration.Builder fallbackToSystemTrustStore​(Boolean fallbackToSystemTrustStore)

Indicate if system default truststore can be used.

Parameters:
  `fallbackToSystemTrustStore` - indicate if system default truststore can be used..
Returns:
  this `Configuration.Builder`

#### database

    public Configuration.Builder database​(String database)

Set default database

Parameters:
  `database` - database
Returns:
  this `Configuration.Builder`

#### haMode

    public Configuration.Builder haMode​(HaMode haMode)

Set failover High-availability mode

Parameters:
  `haMode` - High-availability mode
Returns:
  this `Configuration.Builder`

#### addHost

    public Configuration.Builder addHost​(String host,
                                         int port)

Add Host to possible addresses to connect

Parameters:
  `host` - hostname or IP
  `port` - port
Returns:
  this `Configuration.Builder`

#### addHost

    public Configuration.Builder addHost​(String host,
                                         int port,
                                         String sslMode)

Add Host to possible addresses to connect

Parameters:
  `host` - hostname or IP
  `port` - port
  `sslMode` - ssl mode. possible values disable/trust/verify-ca/verify-full
Returns:
  this `Configuration.Builder`

#### addHost

    public Configuration.Builder addHost​(String host,
                                         int port,
                                         boolean master)

Add Host to possible addresses to connect

Parameters:
  `host` - hostname or IP
  `port` - port
  `master` - is master or replica
Returns:
  this `Configuration.Builder`

#### addHost

    public Configuration.Builder addHost​(String host,
                                         int port,
                                         boolean master,
                                         String sslMode)

Add Host to possible addresses to connect

Parameters:
  `host` - hostname or IP
  `port` - port
  `master` - is master or replica
  `sslMode` - ssl mode. possible values disable/trust/verify-ca/verify-full
Returns:
  this `Configuration.Builder`

#### addPipeHost

    public Configuration.Builder addPipeHost​(String pipe)

Add a windows pipe host

Parameters:
  `pipe` - windows pipe path
Returns:
  this `Configuration.Builder`

#### addLocalSocketHost

    public Configuration.Builder addLocalSocketHost​(String localSocket)

Add a unix socket host

Parameters:
  `localSocket` - unix socket path
Returns:
  this `Configuration.Builder`

#### addresses

    public Configuration.Builder addresses​(HostAddress... hostAddress)

add host addresses

Parameters:
  `hostAddress` - host addresses
Returns:
  this `Configuration.Builder`

#### addresses

    public Configuration.Builder addresses​(List<HostAddress> hostAddress)

add host addresses

Parameters:
  `hostAddress` - host addresses
Returns:
  this `Configuration.Builder`

#### socketFactory

    public Configuration.Builder socketFactory​(String socketFactory)

Socket factory

Parameters:
  `socketFactory` - socket factory
Returns:
  this `Configuration.Builder`

#### connectTimeout

    public Configuration.Builder connectTimeout​(Integer connectTimeout)

Indicate connect timeout value, in milliseconds, or zero for no timeout. Default: 30000

Parameters:
  `connectTimeout` - connect Timeout
Returns:
  this `Configuration.Builder`

#### pipe

    public Configuration.Builder pipe​(String pipe)

Indicate to use windows named pipe, specify named pipe name to connect

Parameters:
  `pipe` - windows named pipe
Returns:
  this `Configuration.Builder`

#### localSocket

    public Configuration.Builder 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).

Parameters:
  `localSocket` - local socket path
Returns:
  this `Configuration.Builder`

#### tcpKeepAlive

    public Configuration.Builder tcpKeepAlive​(Boolean tcpKeepAlive)

Indicate if TCP keep-alive must be enabled.

Parameters:
  `tcpKeepAlive` - value
Returns:
  this `Configuration.Builder`

#### uuidAsString

    public Configuration.Builder uuidAsString​(Boolean uuidAsString)

Indicate if UUID fields must returns as String

Parameters:
  `uuidAsString` - value
Returns:
  this `Configuration.Builder`

#### tcpKeepIdle

    public Configuration.Builder tcpKeepIdle​(Integer tcpKeepIdle)

Indicate TCP keep-idle value (for java 11+ only).

Parameters:
  `tcpKeepIdle` - value
Returns:
  this `Configuration.Builder`

#### tcpKeepCount

    public Configuration.Builder tcpKeepCount​(Integer tcpKeepCount)

Indicate TCP keep-count value (for java 11+ only).

Parameters:
  `tcpKeepCount` - value
Returns:
  this `Configuration.Builder`

#### tcpKeepInterval

    public Configuration.Builder tcpKeepInterval​(Integer tcpKeepInterval)

Indicate TCP keep-interval value (for java 11+ only).

Parameters:
  `tcpKeepInterval` - value
Returns:
  this `Configuration.Builder`

#### tcpAbortiveClose

    public Configuration.Builder tcpAbortiveClose​(Boolean tcpAbortiveClose)

Indicate that when connection fails, to send an RST TCP packet.

Parameters:
  `tcpAbortiveClose` - value
Returns:
  this `Configuration.Builder`

#### geometryDefaultType

    public Configuration.Builder geometryDefaultType​(String geometryDefault)

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

In the future JTS might be implemented

Parameters:
  `geometryDefault` - value
Returns:
  this `Configuration.Builder`

#### restrictedAuth

    public Configuration.Builder restrictedAuth​(String restrictedAuth)

restrict authentication method to secure list. Default "default".

Parameters:
  `restrictedAuth` - use authentication plugin list
Returns:
  this `Configuration.Builder`

#### initSql

    public Configuration.Builder initSql​(String initSql)

permit to execute an SQL command on connection creation

Parameters:
  `initSql` - initial SQL command
Returns:
  this `Configuration.Builder`

#### localSocketAddress

    public Configuration.Builder localSocketAddress​(String 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

    public Configuration.Builder socketTimeout​(Integer 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

    public Configuration.Builder allowMultiQueries​(Boolean 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

    public Configuration.Builder allowLocalInfile​(Boolean 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

    public Configuration.Builder useCompression​(Boolean 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

    public Configuration.Builder blankTableNameMeta​(Boolean blankTableNameMeta)

Set blank table name for metadata (old oracle compatibility)

Parameters:
  `blankTableNameMeta` - use blank table name
Returns:
  this `Configuration.Builder`

#### credentialType

    public Configuration.Builder credentialType​(String credentialType)

set credential plugin type

Parameters:
  `credentialType` - credential plugin type
Returns:
  this `Configuration.Builder`

#### sslMode

    public Configuration.Builder sslMode​(String sslMode)

Set ssl model

Parameters:
  `sslMode` - ssl requirement
Returns:
  this `Configuration.Builder`

#### transactionIsolation

    public Configuration.Builder transactionIsolation​(String transactionIsolation)

force default transaction isolation, not using server default

Parameters:
  `transactionIsolation` - indicate default transaction isolation
Returns:
  this `Configuration.Builder`

#### enabledSslCipherSuites

    public Configuration.Builder enabledSslCipherSuites​(String enabledSslCipherSuites)

set possible cipher list (comma separated), not using default java cipher list

Parameters:
  `enabledSslCipherSuites` - ssl cipher list
Returns:
  this `Configuration.Builder`

#### sessionVariables

    public Configuration.Builder sessionVariables​(String sessionVariables)

set connection session variables (comma separated)

Parameters:
  `sessionVariables` - session variable list
Returns:
  this `Configuration.Builder`

#### tinyInt1isBit

    public Configuration.Builder tinyInt1isBit​(Boolean tinyInt1isBit)

TinyInt(1) to be considered as bit

Parameters:
  `tinyInt1isBit` - Indicate if Tinyint(1) to be considered as bit
Returns:
  this `Configuration.Builder`

#### transformedBitIsBoolean

    public Configuration.Builder transformedBitIsBoolean​(Boolean transformedBitIsBoolean)

TinyInt(1) to be considered as boolean

Parameters:
  `transformedBitIsBoolean` - Indicate if Tinyint(1) to be considered as boolean
Returns:
  this `Configuration.Builder`

#### yearIsDateType

    public Configuration.Builder yearIsDateType​(Boolean yearIsDateType)

Year datatype to be considered as date

Parameters:
  `yearIsDateType` - indicate if Year must be considered as Date
Returns:
  this `Configuration.Builder`

#### timezone

    public Configuration.Builder timezone​(String timezone)

Force timezone to use this timezone, not default java one

Parameters:
  `timezone` - default timezone
Returns:
  this `Configuration.Builder`

#### connectionTimeZone

    public Configuration.Builder connectionTimeZone​(String connectionTimeZone)

indicate what timestamp timezone to use in exchanges with server possible value are LOCAL|SERVER|user-defined time zone

Parameters:
  `connectionTimeZone` - default timezone
Returns:
  this `Configuration.Builder`

#### connectionCollation

    public Configuration.Builder connectionCollation​(String connectionCollation)

indicate what utf8mb4 collation to use. if not set, server default collation for utf8mb4 will be used

Parameters:
  `connectionCollation` - utf8mb4 collation to use
Returns:
  this `Configuration.Builder`

#### forceConnectionTimeZoneToSession

    public Configuration.Builder forceConnectionTimeZoneToSession​(Boolean forceConnectionTimeZoneToSession)

Indicate if connectionTimeZone must be forced to session

Parameters:
  `forceConnectionTimeZoneToSession` - must connector force connection timezone
Returns:
  this `Configuration.Builder`

#### preserveInstants

    public Configuration.Builder preserveInstants​(Boolean preserveInstants)

Indicate if connection must preserve instants

Parameters:
  `preserveInstants` - must connector preserve instants
Returns:
  this `Configuration.Builder`

#### dumpQueriesOnException

    public Configuration.Builder dumpQueriesOnException​(Boolean dumpQueriesOnException)

Must queries be dump on exception stracktrace.

Parameters:
  `dumpQueriesOnException` - must queries be dump on exception
Returns:
  this `Configuration.Builder`

#### prepStmtCacheSize

    public Configuration.Builder prepStmtCacheSize​(Integer prepStmtCacheSize)

If using server prepared statement, set LRU prepare cache size

Parameters:
  `prepStmtCacheSize` - prepare cache size
Returns:
  this `Configuration.Builder`

#### useAffectedRows

    public Configuration.Builder useAffectedRows​(Boolean useAffectedRows)

Indicate server to return affected rows in place of found rows. This impact the return number of rows affected by update

Parameters:
  `useAffectedRows` - Indicate to user affected rows in place of found rows
Returns:
  this `Configuration.Builder`

#### useServerPrepStmts

    public Configuration.Builder useServerPrepStmts​(Boolean useServerPrepStmts)

Indicate to use Client or Server prepared statement

Parameters:
  `useServerPrepStmts` - use Server prepared statement
Returns:
  this `Configuration.Builder`

#### connectionAttributes

    public Configuration.Builder connectionAttributes​(String connectionAttributes)

Additional connection attributes to identify connection

Parameters:
  `connectionAttributes` - additional connection attributes
Returns:
  this `Configuration.Builder`

#### useBulkStmts

    public Configuration.Builder useBulkStmts​(Boolean useBulkStmts)

Use server dedicated bulk batch command

Parameters:
  `useBulkStmts` - use server bulk batch command.
Returns:
  this `Configuration.Builder`

#### useBulkStmtsForInserts

    public Configuration.Builder useBulkStmtsForInserts​(Boolean useBulkStmtsForInserts)

Use server dedicated bulk batch command for insert (if useBulkStmts is enabled, useBulkStmtsForInserts will be enabled as well)

Parameters:
  `useBulkStmtsForInserts` - use server bulk batch command.
Returns:
  this `Configuration.Builder`

#### disablePipeline

    public Configuration.Builder disablePipeline​(Boolean disablePipeline)

Disable pipeline

Parameters:
  `disablePipeline` - disable pipeline.
Returns:
  this `Configuration.Builder`

#### autocommit

    public Configuration.Builder autocommit​(Boolean autocommit)

Permit to force autocommit connection value

Parameters:
  `autocommit` - autocommit value
Returns:
  this `Configuration.Builder`

#### useMysqlMetadata

    public Configuration.Builder useMysqlMetadata​(Boolean 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`

#### nullDatabaseMeansCurrent

    public Configuration.Builder nullDatabaseMeansCurrent​(Boolean nullDatabaseMeansCurrent)

Permit indicating in DatabaseMetadata if null value must be considered current schema/catalog

Parameters:
  `nullDatabaseMeansCurrent` - indicating in DatabaseMetadata if null value must be considered current schema/catalog
Returns:
  this `Configuration.Builder`

#### useCatalogTerm

    public Configuration.Builder useCatalogTerm​(String useCatalogTerm)

"schema" and "database" are server synonymous. Connector historically get/set database using Connection.setCatalog()/getCatalog(), setSchema()/getSchema() being no-op This parameter indicate to change that behavior to use Schema in place of Catalog. Behavior will change

- database change will be done with either Connection.setCatalog()/getCatalog() or Connection.setSchema()/getSchema()
- DatabaseMetadata methods that use catalog or schema filtering
- ResultsetMetadata database will be retrieved

Parameters:
  `useCatalogTerm` - use CATALOG/SCHEMA
Returns:
  this `Configuration.Builder`

#### createDatabaseIfNotExist

    public Configuration.Builder createDatabaseIfNotExist​(Boolean createDatabaseIfNotExist)

Create database if not exist. This is mainly for test, since does require an additional query after connection

Parameters:
  `createDatabaseIfNotExist` - must driver create database if doesn't exist
Returns:
  this `Configuration.Builder`

#### useLocalSessionState

    public Configuration.Builder useLocalSessionState​(Boolean useLocalSessionState)

indicate if connector can 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

Parameters:
  `useLocalSessionState` - can driver rely on local state
Returns:
  this `Configuration.Builder`

#### returnMultiValuesGeneratedIds

    public Configuration.Builder returnMultiValuesGeneratedIds​(Boolean returnMultiValuesGeneratedIds)

indicate if connector must return multi-generated ids. (For connector 2.x compatibility)

Parameters:
  `returnMultiValuesGeneratedIds` - must return multi-values generated ids
Returns:
  this `Configuration.Builder`

#### jdbcCompliantTruncation

    public Configuration.Builder jdbcCompliantTruncation​(Boolean jdbcCompliantTruncation)

indicate if connector must force sql_mode strict mode for jdbc compliance

Parameters:
  `jdbcCompliantTruncation` - must force sql_mode strict mode for jdbc compliance
Returns:
  this `Configuration.Builder`

#### permitRedirect

    public Configuration.Builder permitRedirect​(Boolean permitRedirect)

indicate if connector must redirect connection when receiving server redirect information

Parameters:
  `permitRedirect` - must redirect when required
Returns:
  this `Configuration.Builder`

#### pinGlobalTxToPhysicalConnection

    public Configuration.Builder pinGlobalTxToPhysicalConnection​(Boolean pinGlobalTxToPhysicalConnection)

Indicate if for XA transaction, connector must reuse same connection.

Parameters:
  `pinGlobalTxToPhysicalConnection` - force reuse of same connection
Returns:
  this `Configuration.Builder`

#### includeInnodbStatusInDeadlockExceptions

    public Configuration.Builder includeInnodbStatusInDeadlockExceptions​(Boolean includeInnodbStatusInDeadlockExceptions)

On dead-lock exception must add innodb status in exception error message. If enabled, an additional command will be done to retrieve innodb status when dead-lock occurs.

Parameters:
  `includeInnodbStatusInDeadlockExceptions` - Must dead-lock exception must add innodb status in exception error message
Returns:
  this `Configuration.Builder`

#### includeThreadDumpInDeadlockExceptions

    public Configuration.Builder includeThreadDumpInDeadlockExceptions​(Boolean includeThreadDumpInDeadlockExceptions)

Dead-lock error will contain threads information

Parameters:
  `includeThreadDumpInDeadlockExceptions` - must dead-lock error contain treads informations
Returns:
  this `Configuration.Builder`

#### servicePrincipalName

    public Configuration.Builder servicePrincipalName​(String servicePrincipalName)

set service principal name (GSSAPI)

Parameters:
  `servicePrincipalName` - service principal name (GSSAPI)
Returns:
  this `Configuration.Builder`

#### defaultFetchSize

    public Configuration.Builder defaultFetchSize​(Integer defaultFetchSize)

Set default fetch size

Parameters:
  `defaultFetchSize` - default fetch size
Returns:
  this `Configuration.Builder`

#### tlsSocketType

    public Configuration.Builder tlsSocketType​(String tlsSocketType)

Permit to defined default tls plugin type

Parameters:
  `tlsSocketType` - default tls socket plugin to use
Returns:
  this `Configuration.Builder`

#### maxQuerySizeToLog

    public Configuration.Builder maxQuerySizeToLog​(Integer maxQuerySizeToLog)

Set the log size limit for query

Parameters:
  `maxQuerySizeToLog` - set query size limit
Returns:
  this `Configuration.Builder`

#### maxAllowedPacket

    public Configuration.Builder maxAllowedPacket​(Integer maxAllowedPacket)

Indicate to driver server max_allowed_packet. This permit to driver to avoid sending commands too big, that would have make server to drop connection

Parameters:
  `maxAllowedPacket` - indicate server max_allowed_packet value
Returns:
  this `Configuration.Builder`

#### retriesAllDown

    public Configuration.Builder retriesAllDown​(Integer retriesAllDown)

When failover occurs, how many connection attempt before throwing error when reconnecting

Parameters:
  `retriesAllDown` - number of attemps to reconnect
Returns:
  this `Configuration.Builder`

#### galeraAllowedState

    public Configuration.Builder galeraAllowedState​(String galeraAllowedState)

Indicate galera allowed state (comma separated), permitting to validate if galera node is synchronized

Parameters:
  `galeraAllowedState` - galera allowed state
Returns:
  this `Configuration.Builder`

#### pool

    public Configuration.Builder pool​(Boolean pool)

Create pool if not existing, or get a connection for the pool associate with this connection string if existing.

Parameters:
  `pool` - use pool
Returns:
  this `Configuration.Builder`

#### poolName

    public Configuration.Builder poolName​(String poolName)

set pool name

Parameters:
  `poolName` - pool name
Returns:
  this `Configuration.Builder`

#### maxPoolSize

    public Configuration.Builder maxPoolSize​(Integer maxPoolSize)

Set the limit number of connection in pool.

Parameters:
  `maxPoolSize` - maximum connection size in pool.
Returns:
  this `Configuration.Builder`

#### minPoolSize

    public Configuration.Builder minPoolSize​(Integer minPoolSize)

Minimum pool size.

Parameters:
  `minPoolSize` - minimum pool size
Returns:
  this `Configuration.Builder`

#### maxIdleTime

    public Configuration.Builder maxIdleTime​(Integer maxIdleTime)

Set the maximum idle time of a connection indicating that connection must be released

Parameters:
  `maxIdleTime` - maximum idle time of a connection in pool
Returns:
  this `Configuration.Builder`

#### registerJmxPool

    public Configuration.Builder registerJmxPool​(Boolean registerJmxPool)

Must pool register JMX information

Parameters:
  `registerJmxPool` - register pool to JMX
Returns:
  this `Configuration.Builder`

#### poolValidMinDelay

    public Configuration.Builder poolValidMinDelay​(Integer poolValidMinDelay)

Pool will validate connection before giving it. This amount of time indicate that recently use connection can skip validation 0 means connection will be validated each time (even is just used)

Parameters:
  `poolValidMinDelay` - time limit indicating that connection in pool must be validated
Returns:
  this `Configuration.Builder`

#### useResetConnection

    public Configuration.Builder useResetConnection​(Boolean useResetConnection)

Indicate that connection returned to pool must be RESETed like having proper connection state.

Parameters:
  `useResetConnection` - use reset connection when returning connection to pool.
Returns:
  this `Configuration.Builder`

#### serverRsaPublicKeyFile

    public Configuration.Builder serverRsaPublicKeyFile​(String serverRsaPublicKeyFile)

MySQL Authentication RSA server file, for mysql authentication

Parameters:
  `serverRsaPublicKeyFile` - server RSA public key file
Returns:
  this `Configuration.Builder`

#### allowPublicKeyRetrieval

    public Configuration.Builder allowPublicKeyRetrieval​(Boolean allowPublicKeyRetrieval)

Allow RSA server file retrieval from MySQL server

Parameters:
  `allowPublicKeyRetrieval` - Allow RSA server file retrieval from MySQL server
Returns:
  this `Configuration.Builder`

#### useReadAheadInput

    public Configuration.Builder useReadAheadInput​(Boolean useReadAheadInput)

Cache all socket available information.

Parameters:
  `useReadAheadInput` - cache available socket data when reading socket.
Returns:
  this `Configuration.Builder`

#### cachePrepStmts

    public Configuration.Builder cachePrepStmts​(Boolean cachePrepStmts)

Cache server prepare result

Parameters:
  `cachePrepStmts` - cache server prepared result
Returns:
  this `Configuration.Builder`

#### transactionReplay

    public Configuration.Builder transactionReplay​(Boolean transactionReplay)

Must cache commands in transaction and replay transaction on failover.

Parameters:
  `transactionReplay` - cache transaction and replay on failover
Returns:
  this `Configuration.Builder`

#### transactionReplaySize

    public Configuration.Builder transactionReplaySize​(Integer transactionReplaySize)

Transaction replay cache size

Parameters:
  `transactionReplaySize` - transaction replay cache size
Returns:
  this `Configuration.Builder`

#### build

    public Configuration build()
                        throws SQLException

Build a configuration

Returns:
  a Configuration object
Throws:
  `SQLException` - if option data type doesn't correspond