public class MySqlJdbcContext extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
config |
protected static JdbcConnection.ConnectionFactory |
FACTORY |
protected JdbcConnection |
jdbc |
protected static String |
JDBC_PROPERTY_LEGACY_DATETIME |
protected org.slf4j.Logger |
logger |
protected static String |
MYSQL_CONNECTION_URL |
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 |
| Constructor and Description |
|---|
MySqlJdbcContext(MySqlConnectorConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Configuration |
config() |
protected String |
connectionString() |
CommonConnectorConfig.EventProcessingFailureHandlingMode |
eventProcessingFailureHandlingMode() |
protected String |
getSessionVariableForSslVersion()
Read the Ssl Version session variable.
|
String |
hostname() |
CommonConnectorConfig.EventProcessingFailureHandlingMode |
inconsistentSchemaHandlingMode() |
boolean |
isGtidModeEnabled()
Determine whether the MySQL server has GTIDs enabled.
|
JdbcConnection |
jdbc() |
String |
knownGtidSet()
Determine the executed GTID set for MySQL.
|
org.slf4j.Logger |
logger() |
String |
password() |
int |
port() |
GtidSet |
purgedGtidSet()
Get the purged GTID values from MySQL (gtid_purged value)
|
private Map<String,String> |
querySystemVariables(String statement) |
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) |
void |
shutdown() |
MySqlConnectorConfig.SecureConnectionMode |
sslMode() |
boolean |
sslModeEnabled() |
void |
start() |
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.
|
String |
username() |
protected static final String MYSQL_CONNECTION_URL
protected static final String JDBC_PROPERTY_LEGACY_DATETIME
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 JdbcConnection.ConnectionFactory FACTORY
protected final org.slf4j.Logger logger
protected final Configuration config
protected final JdbcConnection jdbc
public MySqlJdbcContext(MySqlConnectorConfig config)
public Configuration config()
public JdbcConnection jdbc()
public org.slf4j.Logger logger()
public String username()
public String password()
public String hostname()
public int port()
public MySqlConnectorConfig.SecureConnectionMode sslMode()
public boolean sslModeEnabled()
public CommonConnectorConfig.EventProcessingFailureHandlingMode eventProcessingFailureHandlingMode()
public CommonConnectorConfig.EventProcessingFailureHandlingMode inconsistentSchemaHandlingMode()
public void start()
public void shutdown()
public void close()
close in interface AutoCloseablepublic 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 otherwiseprotected String connectionString()
protected Map<String,String> readMySqlCharsetSystemVariables()
protected Map<String,String> readMySqlSystemVariables()
protected void setSystemProperty(String property, Field field, boolean showValueInError)
protected String getSessionVariableForSslVersion()
Copyright © 2021 JBoss by Red Hat. All rights reserved.