public class MySqlConnection extends JdbcConnection
JdbcConnection extension to be used with MySQL Server| Modifier and Type | Class and Description |
|---|---|
static class |
MySqlConnection.MySqlConnectionConfiguration |
JdbcConnection.BlockingMultiResultSetConsumer, JdbcConnection.BlockingResultSetConsumer, JdbcConnection.CallPreparer, JdbcConnection.ConnectionFactory, JdbcConnection.MultiResultSetConsumer, JdbcConnection.Operations, JdbcConnection.ParameterResultSetConsumer, JdbcConnection.ResultSetConsumer, JdbcConnection.ResultSetExtractor<T>, JdbcConnection.ResultSetMapper<T>, JdbcConnection.StatementFactory, JdbcConnection.StatementPreparer| Modifier and Type | Field and Description |
|---|---|
private MySqlConnection.MySqlConnectionConfiguration |
connectionConfig |
private static org.slf4j.Logger |
LOGGER |
private Map<String,String> |
originalSystemProperties |
private static String |
SQL_SHOW_SESSION_VARIABLE_SSL_VERSION |
private static String |
SQL_SHOW_SYSTEM_VARIABLES |
private static String |
SQL_SHOW_SYSTEM_VARIABLES_CHARACTER_SET |
protected static String |
URL_PATTERN |
| Constructor and Description |
|---|
MySqlConnection(MySqlConnection.MySqlConnectionConfiguration connectionConfig)
Creates a new connection using the supplied configuration.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
availableBinlogFiles()
Query the database server to get the list of the binlog files availble.
|
void |
close() |
Connection |
connection(boolean executeOnConnect) |
String |
connectionString() |
String |
earliestBinlogFilename()
Determine the earliest binlog filename that is still available in the server.
|
OptionalLong |
getEstimatedTableSize(TableId tableId) |
protected String |
getSessionVariableForSslVersion()
Read the Ssl Version session variable.
|
protected boolean |
isBinlogFormatRow()
Determine whether the MySQL server has the row-level binlog enabled.
|
protected boolean |
isBinlogRowImageFull()
Determine whether the MySQL server has the binlog_row_image set to 'FULL'.
|
boolean |
isGtidModeEnabled()
Determine whether the MySQL server has GTIDs enabled.
|
boolean |
isTableIdCaseSensitive() |
String |
knownGtidSet()
Determine the executed GTID set for MySQL.
|
GtidSet |
purgedGtidSet()
Get the purged GTID values from MySQL (gtid_purged value)
|
private Map<String,String> |
querySystemVariables(String statement) |
protected Map<String,MySqlJdbcContext.DatabaseLocales> |
readDatabaseCollations()
Read the MySQL default character sets for exisiting databases.
|
protected Map<String,String> |
readMySqlCharsetSystemVariables()
Read the MySQL charset-related system variables.
|
protected Map<String,String> |
readMySqlSystemVariables()
Read the MySQL system variables.
|
protected String |
setStatementFor(Map<String,String> variables) |
protected void |
setSystemProperty(String property,
Field field,
boolean showValueInError) |
GtidSet |
subtractGtidSet(GtidSet set1,
GtidSet set2)
Determine the difference between two sets.
|
boolean |
userHasPrivileges(String grantName)
Determine if the current user has the named privilege.
|
call, commit, config, connect, connection, connectionString, database, execute, execute, executeWithoutCommitting, getDefaultValue, isConnected, isNullable, isTableUniqueIndexIncluded, parseSqlStatementString, patternBasedFactory, patternBasedFactory, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQueryAndMap, prepareQueryWithBlockingConsumer, prepareUpdate, print, print, query, query, queryAndMap, queryAndMap, querySingleValue, queryWithBlockingConsumer, readAllCatalogNames, readAllSchemaNames, readAllTableNames, readPrimaryKeyNames, readPrimaryKeyOrUniqueIndexNames, readSchema, readTableColumn, readTableNames, readTableUniqueIndices, resolveJdbcType, resolveNativeType, rollback, setAutoCommit, singleResultMapper, tableTypes, usernameprivate static org.slf4j.Logger LOGGER
private static final String SQL_SHOW_SYSTEM_VARIABLES
private static final String SQL_SHOW_SYSTEM_VARIABLES_CHARACTER_SET
private static final String SQL_SHOW_SESSION_VARIABLE_SSL_VERSION
protected static final String URL_PATTERN
private final MySqlConnection.MySqlConnectionConfiguration connectionConfig
public MySqlConnection(MySqlConnection.MySqlConnectionConfiguration connectionConfig)
config - Configuration instance, may not be null.sourceTimestampMode - strategy for populating source.ts_ms.config - Configuration instance, may not be null.valueConverters - SqlServerValueConverters instancepublic Connection connection(boolean executeOnConnect) throws SQLException
connection in class JdbcConnectionSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in class JdbcConnectionSQLExceptionprotected Map<String,String> readMySqlCharsetSystemVariables()
protected Map<String,String> readMySqlSystemVariables()
protected void setSystemProperty(String property, Field field, boolean showValueInError)
protected String getSessionVariableForSslVersion()
public boolean isGtidModeEnabled()
false if the server's gtid_mode is set and is OFF, or true otherwisepublic String knownGtidSet()
public GtidSet subtractGtidSet(GtidSet set1, GtidSet set2)
public GtidSet purgedGtidSet()
public boolean userHasPrivileges(String grantName)
true.grantName - the name of the MySQL privilege; may not be nulltrue if the user has the named privilege, or false otherwisepublic String earliestBinlogFilename()
protected boolean isBinlogRowImageFull()
true if the server's binlog_row_image is set to FULL, or false otherwiseprotected boolean isBinlogFormatRow()
true if the server's binlog_format is set to ROW, or false otherwisepublic List<String> availableBinlogFiles()
public OptionalLong getEstimatedTableSize(TableId tableId)
public boolean isTableIdCaseSensitive()
protected Map<String,MySqlJdbcContext.DatabaseLocales> readDatabaseCollations()
public String connectionString()
Copyright © 2021 JBoss by Red Hat. All rights reserved.