Package io.debezium.connector.mysql
Class MySqlTestConnection
java.lang.Object
io.debezium.jdbc.JdbcConnection
io.debezium.connector.mysql.MySqlTestConnection
- All Implemented Interfaces:
AutoCloseable
A utility for integration test cases to connect the MySQL server running in the Docker container created by this module's
build.
- Author:
- Randall Hauch
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.debezium.jdbc.JdbcConnection
JdbcConnection.BlockingMultiResultSetConsumer, JdbcConnection.BlockingResultSetConsumer, JdbcConnection.CallPreparer, JdbcConnection.ConnectionFactory, JdbcConnection.MultiResultSetConsumer, JdbcConnection.Operations, JdbcConnection.ParameterResultSetConsumer, JdbcConnection.ResultSetConsumer, JdbcConnection.ResultSetExtractor<T extends Object>, JdbcConnection.ResultSetMapper<T extends Object>, JdbcConnection.StatementFactory, JdbcConnection.StatementPreparer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DatabaseDifferencesprotected static JdbcConnection.ConnectionFactoryprivate MySqlTestConnection.MySqlVersion -
Constructor Summary
ConstructorsConstructorDescriptionMySqlTestConnection(JdbcConfiguration config) Create a new instance with the given configuration and connection factory. -
Method Summary
Modifier and TypeMethodDescriptionprivate static JdbcConfigurationaddDefaultSettings(JdbcConfiguration configuration) static MySqlTestConnectionforTestDatabase(String databaseName) Obtain a connection instance to the named test database.static MySqlTestConnectionforTestDatabase(String databaseName, String username, String password) Obtain a connection instance to the named test database.static MySqlTestConnectionforTestDatabase(String databaseName, Map<String, Object> urlProperties) Obtain a connection instance to the named test database.static booleanisMySQL5()Obtain whether the database source is MySQL 5.x or not.static booleanObtain whether the database source is the Percona Server fork.booleanMethods inherited from class io.debezium.jdbc.JdbcConnection
buildSelectWithRowLimits, call, close, commit, config, connect, connection, connection, connectionString, database, execute, execute, executeWithoutCommitting, getColumnsDetails, getColumnValue, isConnected, isNullable, isTableUniqueIndexIncluded, isValid, loadKeyStore, overrideColumn, parseSqlStatementString, patternBasedFactory, patternBasedFactory, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQueryAndMap, prepareQueryWithBlockingConsumer, prepareUpdate, print, print, query, query, queryAndMap, queryAndMap, querySingleValue, queryWithBlockingConsumer, quotedColumnIdString, quotedTableIdString, readAllCatalogNames, readAllSchemaNames, readAllTableNames, readPrimaryKeyNames, readPrimaryKeyOrUniqueIndexNames, readSchema, readTableColumn, readTableNames, readTablePreparedStatement, readTableStatement, readTableUniqueIndices, resolveCatalogName, resolveJdbcType, resolveNativeType, rollback, rowToArray, setAutoCommit, singleResultMapper, tableTypes, username
-
Field Details
-
databaseAsserts
-
mySqlVersion
-
FACTORY
-
-
Constructor Details
-
MySqlTestConnection
Create a new instance with the given configuration and connection factory.- Parameters:
config- the configuration; may not be null
-
-
Method Details
-
forTestDatabase
Obtain a connection instance to the named test database.- Parameters:
databaseName- the name of the test database- Returns:
- the MySQLConnection instance; never null
-
forTestDatabase
public static MySqlTestConnection forTestDatabase(String databaseName, Map<String, Object> urlProperties) Obtain a connection instance to the named test database.- Parameters:
databaseName- the name of the test databaseurlProperties- url properties- Returns:
- the MySQLConnection instance; never null
-
forTestDatabase
public static MySqlTestConnection forTestDatabase(String databaseName, String username, String password) Obtain a connection instance to the named test database.- Parameters:
databaseName- the name of the test databaseusername- the usernamepassword- the password- Returns:
- the MySQLConnection instance; never null
-
isMySQL5
public static boolean isMySQL5()Obtain whether the database source is MySQL 5.x or not.- Returns:
- true if the database version is 5.x; otherwise false.
-
isPerconaServer
public static boolean isPerconaServer()Obtain whether the database source is the Percona Server fork.- Returns:
- true if the database is Percona Server; otherwise false.
-
addDefaultSettings
-
getMySqlVersion
-
getMySqlVersionString
-
getMySqlVersionComment
-
isTableIdCaseSensitive
public boolean isTableIdCaseSensitive() -
databaseAsserts
-