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.
  • Field Details

    • _nonMappedOptions

      private Properties _nonMappedOptions
    • _haMode

      private HaMode _haMode
    • _addresses

      private List<HostAddress> _addresses
    • user

      private String user
    • password

      private String password
    • database

      private String database
    • timezone

      private String timezone
    • connectionTimeZone

      private String connectionTimeZone
    • connectionCollation

      private String connectionCollation
    • forceConnectionTimeZoneToSession

      private Boolean forceConnectionTimeZoneToSession
    • preserveInstants

      private Boolean preserveInstants
    • autocommit

      private Boolean autocommit
    • useMysqlMetadata

      private Boolean useMysqlMetadata
    • nullDatabaseMeansCurrent

      private Boolean nullDatabaseMeansCurrent
    • useCatalogTerm

      private String useCatalogTerm
    • createDatabaseIfNotExist

      private Boolean createDatabaseIfNotExist
    • useLocalSessionState

      private Boolean useLocalSessionState
    • returnMultiValuesGeneratedIds

      private Boolean returnMultiValuesGeneratedIds
    • jdbcCompliantTruncation

      private Boolean jdbcCompliantTruncation
    • permitRedirect

      private Boolean permitRedirect
    • pinGlobalTxToPhysicalConnection

      private Boolean pinGlobalTxToPhysicalConnection
    • defaultFetchSize

      private Integer defaultFetchSize
    • maxQuerySizeToLog

      private Integer maxQuerySizeToLog
    • maxAllowedPacket

      private Integer maxAllowedPacket
    • geometryDefaultType

      private String geometryDefaultType
    • restrictedAuth

      private String restrictedAuth
    • initSql

      private String initSql
    • transactionIsolation

      private String transactionIsolation
    • socketFactory

      private String socketFactory
    • connectTimeout

      private Integer connectTimeout
    • pipe

      private String pipe
    • localSocket

      private String localSocket
    • tcpKeepAlive

      private Boolean tcpKeepAlive
    • uuidAsString

      private Boolean uuidAsString
    • tcpKeepIdle

      private Integer tcpKeepIdle
    • tcpKeepCount

      private Integer tcpKeepCount
    • tcpKeepInterval

      private Integer tcpKeepInterval
    • tcpAbortiveClose

      private Boolean tcpAbortiveClose
    • localSocketAddress

      private String localSocketAddress
    • socketTimeout

      private Integer socketTimeout
    • useReadAheadInput

      private Boolean useReadAheadInput
    • tlsSocketType

      private String tlsSocketType
    • sslMode

      private String sslMode
    • serverSslCert

      private String serverSslCert
    • keyStore

      private String keyStore
    • trustStore

      private String trustStore
    • keyStorePassword

      private String keyStorePassword
    • trustStorePassword

      private String trustStorePassword
    • keyPassword

      private String keyPassword
    • keyStoreType

      private String keyStoreType
    • trustStoreType

      private String trustStoreType
    • enabledSslCipherSuites

      private String enabledSslCipherSuites
    • enabledSslProtocolSuites

      private String enabledSslProtocolSuites
    • fallbackToSystemKeyStore

      private Boolean fallbackToSystemKeyStore
    • fallbackToSystemTrustStore

      private Boolean fallbackToSystemTrustStore
    • allowMultiQueries

      private Boolean allowMultiQueries
    • allowLocalInfile

      private Boolean allowLocalInfile
    • 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 Integer prepStmtCacheSize
    • useServerPrepStmts

      private Boolean useServerPrepStmts
    • credentialType

      private String credentialType
    • sessionVariables

      private String sessionVariables
    • connectionAttributes

      private String connectionAttributes
    • servicePrincipalName

      private String servicePrincipalName
    • 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 Integer retriesAllDown
    • galeraAllowedState

      private String galeraAllowedState
    • transactionReplay

      private Boolean transactionReplay
    • transactionReplaySize

      private Integer transactionReplaySize
    • pool

      private Boolean pool
    • poolName

      private String poolName
    • maxPoolSize

      private Integer maxPoolSize
    • minPoolSize

      private Integer minPoolSize
    • maxIdleTime

      private Integer maxIdleTime
    • registerJmxPool

      private Boolean registerJmxPool
    • poolValidMinDelay

      private Integer poolValidMinDelay
    • useResetConnection

      private Boolean useResetConnection
    • serverRsaPublicKeyFile

      private String serverRsaPublicKeyFile
    • allowPublicKeyRetrieval

      private Boolean allowPublicKeyRetrieval
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • 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