org.mariadb.jdbc.internal.util

## Enum DefaultOptions

- java.lang.Object
- - java.lang.Enum<DefaultOptions>
  - - org.mariadb.jdbc.internal.util.DefaultOptions

All Implemented Interfaces:
  Serializable, Comparable<DefaultOptions>

    public enum DefaultOptions
    extends Enum<DefaultOptions>

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`ALLOW_LOCAL_INFILE` If set to 'false', exception thrown during LOCAL INFILE if no InputStream has already been set.
`ALLOW_MULTI_QUERIES` Allows multiple statements in single executeQuery.
`ASSUREREADONLY` when in high availalability, and switching to a read-only host, assure that this host is in read-only mode by setting session read-only.
`AUTO_RECONNECT` Driver must recreateConnection after a failover.
`CACHE_CALLABLE_STMTS` enable/disable callable Statement cache, default true.
`CACHEPREPSTMTS` enable/disable prepare Statement cache, default true.
`CALLABLE_STMT_CACHE_SIZE` This sets the number of callable statements that the driver will cache per VM if "cacheCallableStmts" is enabled.
`CLIENT_CERTIFICATE_KEYSTORE_PASSWORD` Password for the client certificate keystore.
`CLIENT_CERTIFICATE_KEYSTORE_URL` Use the specified keystore for client certificates (can be the same as the trusted root certificate keystore).
`CONNECT_TIMOUT`
`CONNECTION_ATTRIBUTES` Indicate to server some client information in a key;value pair.
`CONTINUE_BATCH_ON_ERROR` When executing batch queries, must batch continue on error.
`CREATE_DATABASE_IF_NOT_EXISTS` The database precised in url will be created if doesn't exist.
`DUMP_QUERY_ON_EXCEPTION` If set to 'true', exception thrown during query execution contain query string.
`FAIL_ON_READ_ONLY` After a master failover and no other master found, back on a read-only host ( throw exception if not).
`FAILOVER_LOOP_RETRIES` When using failover, the number of times the driver should cycle silently through available hosts, attempting to connect.
`INTERACTIVE_CLIENT` Session timeout is defined by the wait_timeout server variable.
`JDBCOMPLIANTRUNCATION` Truncation error ("Data truncated for column '%' at row %", "Out of range value for column '%' at row %") will be thrown as error, and not as warning.
`LOAD_BALANCE_BLACKLIST_TIMEOUT` time in second a server is blacklisted after a connection failure.
`LOCAL_SOCKET` Allows to connect to database via Unix domain socket, if server allows it.
`LOCAL_SOCKET_ADDRESS` Hostname or IP address to bind the connection socket to a local (UNIX domain) socket.
`MAXIMIZEMYSQLCOMPATIBILITY` maximize Mysql compatibility.
`NULL_CATALOG_MEANS_CURRENT` DatabaseMetaData use current catalog if null.
`PASSWORD` Password of database user.
`PIN_GLOBAL_TX_TO_PHYSICAL_CONNECTION`
`PIPE` On Windows, specify named pipe name to connect to mysqld.exe.
`PREPSTMTCACHESIZE` This sets the number of prepared statements that the driver will cache per VM if "cachePrepStmts" is enabled.
`PREPSTMTCACHESQLLIMIT` This is the maximum length of a prepared SQL statement that the driver will cache if "cachePrepStmts" is enabled.
`RETRY_ALL_DOWN` When using loadbalancing, the number of times the driver should cycle through available hosts, attempting to connect.
`REWRITE_BATCHED_STATEMENTS` rewrite batchedStatement to have only one server call.
`SERVER_SSL_CERT` Server's certificate in DER form, or server's CA certificate.
`SERVER_TIMEZONE` Defined the server time zone.
`SESSION_VARIABLES` var=value pairs separated by comma, mysql session variables, set upon establishing successful connection.
`SHARED_MEMORY` Allowed to connect database via shared memory, if server allows it.
`SOCKET_FACTORY` to use custom socket factory, set it to full name of the class that implements javax.net.SocketFactory.
`SOCKET_TIMEOUT` Defined the network socket timeout (SO_TIMEOUT) in milliseconds. 0 (default) disable this timeout
`TCP_ABORTIVE_CLOSE` Sets corresponding option on the connection socket.
`TCP_KEEP_ALIVE` Sets corresponding option on the connection socket.
`TCP_NO_DELAY` Sets corresponding option on the connection socket.
`TCP_RCV_BUF` set buffer size for TCP buffer (SO_RCVBUF).
`TCP_SND_BUF` set buffer size for TCP buffer (SO_SNDBUF).
`TINY_INT_IS_BIT` Datatype mapping flag, handle MySQL Tiny as BIT(boolean).
`TRUST_CERTIFICATE_KEYSTORE_PASSWORD` Password for the trusted root certificate keystore.
`TRUST_CERTIFICATE_KEYSTORE_URL` Use the specified keystore for trusted root certificates.
`TRUST_SERVER_CERTIFICATE` When using SSL, do not check server's certificate.
`USE_FRACTIONAL_SECONDS` Correctly handle subsecond precision in timestamps (feature available with MariaDB 5.3 and later).
`USE_OLD_ALIAS_METADATA_BEHAVIOR` Metadata ResultSetMetaData.getTableName() return the physical table name.
`USE_SSL` Force SSL on connection.
`USELEGACYDATETIMECODE` if true (default) store date/timestamps according to client time zone.
`USER` Database user name.
`USER_COMPRESSION` allow compression in MySQL Protocol.
`USESERVERPREPSTMTS` useServerPrepStmts must prepared statements be prepared on server side, or just faked on client side.
`VALID_CONNECTION_TIMEOUT` When in multiple hosts, after this time in second without used, verification that the connections havn't been lost.
`YEAR_IS_DATE_TYPE` Year is date type, rather than numerical.

### Field Summary

Fields
`protected Object` `defaultValue`
`protected String` `implementationVersion`
`protected Object` `maxValue`
`protected Object` `minValue`
`protected String` `name`
`protected Object` `objType`
`protected Object` `value`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Options` `addProperty(HaMode haMode, Properties additionnalProperties, Options options)`
`static Options` `addProperty(HaMode haMode, String name, String value, Options options)` Add a property (name + value) to current session options
`boolean` `boolValue()` Return boolean value.
`static Options` `defaultValues(HaMode haMode)`
`static Properties` `getProperties(Options options)` Get properties from session options.
`static String` `getProperties(String optionName, Options options)` Get properties value by name.
`int` `intValue()` Return an integer value.
`static Options` `parse(HaMode haMode, String urlParameters, Options options)`
`static Options` `parse(HaMode haMode, String urlParameters, Properties properties)`
`static Options` `parse(HaMode haMode, String urlParameters, Properties properties, Options options)` Parse additional properties .
`String` `stringValue()` Return String value.
`static DefaultOptions` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static DefaultOptions[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### USER

    public static final DefaultOptions USER

Database user name.

#### PASSWORD

    public static final DefaultOptions PASSWORD

Password of database user.

#### CONNECT_TIMOUT

    public static final DefaultOptions CONNECT_TIMOUT

#### PIPE

    public static final DefaultOptions PIPE

On Windows, specify named pipe name to connect to mysqld.exe.

#### LOCAL_SOCKET

    public static final DefaultOptions LOCAL_SOCKET

Allows to connect to database via Unix domain socket, if server allows it. The value is the path of Unix domain socket, i.e "socket" database parameter.

#### SHARED_MEMORY

    public static final DefaultOptions SHARED_MEMORY

Allowed to connect database via shared memory, if server allows it. The value is base name of the shared memory.

#### TCP_NO_DELAY

    public static final DefaultOptions TCP_NO_DELAY

Sets corresponding option on the connection socket.

#### TCP_ABORTIVE_CLOSE

    public static final DefaultOptions TCP_ABORTIVE_CLOSE

Sets corresponding option on the connection socket.

#### LOCAL_SOCKET_ADDRESS

    public static final DefaultOptions LOCAL_SOCKET_ADDRESS

Hostname or IP address to bind the connection socket to a local (UNIX domain) socket.

#### SOCKET_TIMEOUT

    public static final DefaultOptions SOCKET_TIMEOUT

Defined the network socket timeout (SO_TIMEOUT) in milliseconds. 0 (default) disable this timeout

#### INTERACTIVE_CLIENT

    public static final DefaultOptions INTERACTIVE_CLIENT

Session timeout is defined by the wait_timeout server variable. Setting interactiveClient to true will tell server to use the interactive_timeout server variable

#### DUMP_QUERY_ON_EXCEPTION

    public static final DefaultOptions DUMP_QUERY_ON_EXCEPTION

If set to 'true', exception thrown during query execution contain query string.

#### USE_OLD_ALIAS_METADATA_BEHAVIOR

    public static final DefaultOptions USE_OLD_ALIAS_METADATA_BEHAVIOR

Metadata ResultSetMetaData.getTableName() return the physical table name. "useOldAliasMetadataBehavior" permit to activate the legacy code that send the table alias if set.

#### ALLOW_LOCAL_INFILE

    public static final DefaultOptions ALLOW_LOCAL_INFILE

If set to 'false', exception thrown during LOCAL INFILE if no InputStream has already been set.

#### SESSION_VARIABLES

    public static final DefaultOptions SESSION_VARIABLES

var=value pairs separated by comma, mysql session variables, set upon establishing successful connection.

#### CREATE_DATABASE_IF_NOT_EXISTS

    public static final DefaultOptions CREATE_DATABASE_IF_NOT_EXISTS

The database precised in url will be created if doesn't exist.

#### SERVER_TIMEZONE

    public static final DefaultOptions SERVER_TIMEZONE

Defined the server time zone. to use only if jre server as a different time implementation of the server. (best to have the same server time zone when possible)

#### NULL_CATALOG_MEANS_CURRENT

    public static final DefaultOptions NULL_CATALOG_MEANS_CURRENT

DatabaseMetaData use current catalog if null.

#### TINY_INT_IS_BIT

    public static final DefaultOptions TINY_INT_IS_BIT

Datatype mapping flag, handle MySQL Tiny as BIT(boolean).

#### YEAR_IS_DATE_TYPE

    public static final DefaultOptions YEAR_IS_DATE_TYPE

Year is date type, rather than numerical.

#### USE_SSL

    public static final DefaultOptions USE_SSL

Force SSL on connection.

#### USER_COMPRESSION

    public static final DefaultOptions USER_COMPRESSION

allow compression in MySQL Protocol.

#### ALLOW_MULTI_QUERIES

    public static final DefaultOptions ALLOW_MULTI_QUERIES

Allows multiple statements in single executeQuery.

#### REWRITE_BATCHED_STATEMENTS

    public static final DefaultOptions REWRITE_BATCHED_STATEMENTS

rewrite batchedStatement to have only one server call.

#### TCP_KEEP_ALIVE

    public static final DefaultOptions TCP_KEEP_ALIVE

Sets corresponding option on the connection socket.

#### TCP_RCV_BUF

    public static final DefaultOptions TCP_RCV_BUF

set buffer size for TCP buffer (SO_RCVBUF).

#### TCP_SND_BUF

    public static final DefaultOptions TCP_SND_BUF

set buffer size for TCP buffer (SO_SNDBUF).

#### SOCKET_FACTORY

    public static final DefaultOptions SOCKET_FACTORY

to use custom socket factory, set it to full name of the class that implements javax.net.SocketFactory.

#### PIN_GLOBAL_TX_TO_PHYSICAL_CONNECTION

    public static final DefaultOptions PIN_GLOBAL_TX_TO_PHYSICAL_CONNECTION

#### TRUST_SERVER_CERTIFICATE

    public static final DefaultOptions TRUST_SERVER_CERTIFICATE

When using SSL, do not check server's certificate.

#### SERVER_SSL_CERT

    public static final DefaultOptions SERVER_SSL_CERT

Server's certificate in DER form, or server's CA certificate. Can be used in one of 3 forms, sslServerCert=/path/to/cert.pem (full path to certificate), sslServerCert=classpath:relative/cert.pem (relative to current classpath), or as verbatim DER-encoded certificate string "-----BEGIN CERTIFICATE-----".

#### USE_FRACTIONAL_SECONDS

    public static final DefaultOptions USE_FRACTIONAL_SECONDS

Correctly handle subsecond precision in timestamps (feature available with MariaDB 5.3 and later). May confuse 3rd party components (Hibernated).

#### AUTO_RECONNECT

    public static final DefaultOptions AUTO_RECONNECT

Driver must recreateConnection after a failover.

#### FAIL_ON_READ_ONLY

    public static final DefaultOptions FAIL_ON_READ_ONLY

After a master failover and no other master found, back on a read-only host ( throw exception if not).

#### RETRY_ALL_DOWN

    public static final DefaultOptions RETRY_ALL_DOWN

When using loadbalancing, the number of times the driver should cycle through available hosts, attempting to connect. Between cycles, the driver will pause for 250ms if no servers are available.

#### FAILOVER_LOOP_RETRIES

    public static final DefaultOptions FAILOVER_LOOP_RETRIES

When using failover, the number of times the driver should cycle silently through available hosts, attempting to connect. Between cycles, the driver will pause for 250ms if no servers are available. if set to 0, there will be no silent reconnection

#### VALID_CONNECTION_TIMEOUT

    public static final DefaultOptions VALID_CONNECTION_TIMEOUT

When in multiple hosts, after this time in second without used, verification that the connections havn't been lost. When 0, no verification will be done. Defaults to 120

#### LOAD_BALANCE_BLACKLIST_TIMEOUT

    public static final DefaultOptions LOAD_BALANCE_BLACKLIST_TIMEOUT

time in second a server is blacklisted after a connection failure. default to 50s

#### CACHEPREPSTMTS

    public static final DefaultOptions CACHEPREPSTMTS

enable/disable prepare Statement cache, default true.

#### PREPSTMTCACHESIZE

    public static final DefaultOptions PREPSTMTCACHESIZE

This sets the number of prepared statements that the driver will cache per VM if "cachePrepStmts" is enabled. default to 250.

#### PREPSTMTCACHESQLLIMIT

    public static final DefaultOptions PREPSTMTCACHESQLLIMIT

This is the maximum length of a prepared SQL statement that the driver will cache if "cachePrepStmts" is enabled. default to 2048.

#### ASSUREREADONLY

    public static final DefaultOptions ASSUREREADONLY

when in high availalability, and switching to a read-only host, assure that this host is in read-only mode by setting session read-only. default to false

#### USELEGACYDATETIMECODE

    public static final DefaultOptions USELEGACYDATETIMECODE

if true (default) store date/timestamps according to client time zone. if false, store all date/timestamps in DB according to server time zone, and time information (that is a time difference), doesn't take timezone in account.

#### MAXIMIZEMYSQLCOMPATIBILITY

    public static final DefaultOptions MAXIMIZEMYSQLCOMPATIBILITY

maximize Mysql compatibility. when using jdbc setDate(), will store date in client timezone, not in server timezone when useLegacyDatetimeCode = false. default to false.

#### USESERVERPREPSTMTS

    public static final DefaultOptions USESERVERPREPSTMTS

useServerPrepStmts must prepared statements be prepared on server side, or just faked on client side. if allowMultiQueries or rewriteBatchedStatements is set to true, this options will be set to false. default to true.

#### TRUST_CERTIFICATE_KEYSTORE_URL

    public static final DefaultOptions TRUST_CERTIFICATE_KEYSTORE_URL

Use the specified keystore for trusted root certificates. Overrides serverSslCert.

#### TRUST_CERTIFICATE_KEYSTORE_PASSWORD

    public static final DefaultOptions TRUST_CERTIFICATE_KEYSTORE_PASSWORD

Password for the trusted root certificate keystore.

#### CLIENT_CERTIFICATE_KEYSTORE_URL

    public static final DefaultOptions CLIENT_CERTIFICATE_KEYSTORE_URL

Use the specified keystore for client certificates (can be the same as the trusted root certificate keystore).

#### CLIENT_CERTIFICATE_KEYSTORE_PASSWORD

    public static final DefaultOptions CLIENT_CERTIFICATE_KEYSTORE_PASSWORD

Password for the client certificate keystore.

#### CONTINUE_BATCH_ON_ERROR

    public static final DefaultOptions CONTINUE_BATCH_ON_ERROR

When executing batch queries, must batch continue on error. default to true.

#### JDBCOMPLIANTRUNCATION

    public static final DefaultOptions JDBCOMPLIANTRUNCATION

Truncation error ("Data truncated for column '%' at row %", "Out of range value for column '%' at row %") will be thrown as error, and not as warning.

#### CACHE_CALLABLE_STMTS

    public static final DefaultOptions CACHE_CALLABLE_STMTS

enable/disable callable Statement cache, default true.

#### CALLABLE_STMT_CACHE_SIZE

    public static final DefaultOptions CALLABLE_STMT_CACHE_SIZE

This sets the number of callable statements that the driver will cache per VM if "cacheCallableStmts" is enabled. default to 150.

#### CONNECTION_ATTRIBUTES

    public static final DefaultOptions CONNECTION_ATTRIBUTES

Indicate to server some client information in a key;value pair. for example connectionAttributes=key1:value1,key2,value2. Those information can be retrieved on server within tables mysql.session_connect_attrs and mysql.session_account_connect_attrs. This can permit from server an identification of client.

### Field Detail

#### name

    protected final String name

#### objType

    protected final Object objType

#### defaultValue

    protected final Object defaultValue

#### minValue

    protected final Object minValue

#### maxValue

    protected final Object maxValue

#### implementationVersion

    protected final String implementationVersion

#### value

    protected Object value

### Method Detail

#### values

    public static DefaultOptions[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (DefaultOptions c : DefaultOptions.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static DefaultOptions valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### defaultValues

    public static Options defaultValues(HaMode haMode)

#### addProperty

    public static Options addProperty(HaMode haMode,
                                      String name,
                                      String value,
                                      Options options)

Add a property (name + value) to current session options

Parameters:
  `haMode` - current haMode.
  `name` - property name
  `value` - new property value
  `options` - session options.
Returns:
  new session options.

#### addProperty

    public static Options addProperty(HaMode haMode,
                                      Properties additionnalProperties,
                                      Options options)

#### parse

    public static Options parse(HaMode haMode,
                                String urlParameters,
                                Options options)

#### parse

    public static Options parse(HaMode haMode,
                                String urlParameters,
                                Properties properties)

#### parse

    public static Options parse(HaMode haMode,
                                String urlParameters,
                                Properties properties,
                                Options options)

Parse additional properties .

Parameters:
  `haMode` - current haMode.
  `urlParameters` - options defined in url
  `properties` - options defined by properties
  `options` - initial options
Returns:
  options

#### getProperties

    public static Properties getProperties(Options options)

Get properties from session options.

Parameters:
  `options` - session options.
Returns:
  properties

#### getProperties

    public static String getProperties(String optionName,
                                       Options options)

Get properties value by name.

Parameters:
  `optionName` - String name
  `options` - session options.
Returns:
  string value of option if exists.

#### intValue

    public int intValue()

Return an integer value.

Returns:
  an integer

#### boolValue

    public boolean boolValue()

Return boolean value.

Returns:
  a boolean.

#### stringValue

    public String stringValue()

Return String value.

Returns:
  string