Class MySqlJdbcContext
java.lang.Object
io.debezium.connector.mysql.legacy.MySqlJdbcContext
- All Implemented Interfaces:
AutoCloseable
A context for a JDBC connection to MySQL.
- Author:
- Randall Hauch
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Configurationprotected static JdbcConnection.ConnectionFactoryprotected final JdbcConnectionprotected static final Stringprotected static final org.slf4j.Loggerprotected static final Stringprivate static final Stringprivate static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()config()Read the Ssl Version session variable.hostname()booleanDetermine whether the MySQL server has GTIDs enabled.jdbc()Determine the executed GTID set for MySQL.org.slf4j.Loggerlogger()password()intport()Get the purged GTID values from MySQL (gtid_purged value)querySystemVariables(String statement) protected Map<String,MySqlJdbcContext.DatabaseLocales> Read the MySQL default character sets for exisiting databases.Read the MySQL charset-related system variables.Read the MySQL system variables.protected StringsetStatementFor(Map<String, String> variables) protected voidsetSystemProperty(String property, Field field, boolean showValueInError) voidshutdown()char[]sslMode()booleanchar[]subtractGtidSet(GtidSet set1, GtidSet set2) Determine the difference between two sets.booleanuserHasPrivileges(String grantName) Determine if the current user has the named privilege.username()
-
Field Details
-
MYSQL_CONNECTION_URL
- See Also:
-
JDBC_PROPERTY_LEGACY_DATETIME
- See Also:
-
SQL_SHOW_SYSTEM_VARIABLES
- See Also:
-
SQL_SHOW_SYSTEM_VARIABLES_CHARACTER_SET
- See Also:
-
SQL_SHOW_SESSION_VARIABLE_SSL_VERSION
- See Also:
-
FACTORY
-
logger
protected static final org.slf4j.Logger logger -
config
-
jdbc
-
originalSystemProperties
-
-
Constructor Details
-
MySqlJdbcContext
-
-
Method Details
-
config
-
jdbc
-
logger
public org.slf4j.Logger logger() -
username
-
password
-
hostname
-
port
public int port() -
sslMode
-
sslModeEnabled
public boolean sslModeEnabled() -
sslKeyStore
-
sslKeyStorePassword
public char[] sslKeyStorePassword() -
sslTrustStore
-
sslTrustStorePassword
public char[] sslTrustStorePassword() -
eventProcessingFailureHandlingMode
public CommonConnectorConfig.EventProcessingFailureHandlingMode eventProcessingFailureHandlingMode() -
inconsistentSchemaHandlingMode
-
shutdown
public void shutdown() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
isGtidModeEnabled
public boolean isGtidModeEnabled()Determine whether the MySQL server has GTIDs enabled.- Returns:
falseif the server'sgtid_modeis set and isOFF, ortrueotherwise
-
knownGtidSet
Determine the executed GTID set for MySQL.- Returns:
- the string representation of MySQL's GTID sets; never null but an empty string if the server does not use GTIDs
-
subtractGtidSet
Determine the difference between two sets.- Returns:
- a subtraction of two GTID sets; never null
-
purgedGtidSet
Get the purged GTID values from MySQL (gtid_purged value)- Returns:
- A GTID set; may be empty if not using GTIDs or none have been purged yet
-
userHasPrivileges
Determine if the current user has the named privilege. Note that if the user has the "ALL" privilege this method returnstrue.- Parameters:
grantName- the name of the MySQL privilege; may not be null- Returns:
trueif the user has the named privilege, orfalseotherwise
-
connectionString
-
readMySqlCharsetSystemVariables
Read the MySQL charset-related system variables.- Returns:
- the system variables that are related to server character sets; never null
-
readMySqlSystemVariables
Read the MySQL system variables.- Returns:
- the system variables that are related to server character sets; never null
-
querySystemVariables
-
readDatabaseCollations
Read the MySQL default character sets for exisiting databases.- Returns:
- the map of database names with their default character sets; never null
-
setStatementFor
-
setSystemProperty
-
getSessionVariableForSslVersion
Read the Ssl Version session variable.- Returns:
- the session variables that are related to sessions ssl version
-