public class Db2Connection
extends io.debezium.jdbc.JdbcConnection
JdbcConnection extension to be used with IBM Db2| Modifier and Type | Class and Description |
|---|---|
static class |
Db2Connection.CdcEnabledTable |
private static interface |
Db2Connection.ResultSetExtractor<T> |
io.debezium.jdbc.JdbcConnection.BlockingMultiResultSetConsumer, io.debezium.jdbc.JdbcConnection.BlockingResultSetConsumer, io.debezium.jdbc.JdbcConnection.CallPreparer, io.debezium.jdbc.JdbcConnection.ConnectionFactory, io.debezium.jdbc.JdbcConnection.MultiResultSetConsumer, io.debezium.jdbc.JdbcConnection.Operations, io.debezium.jdbc.JdbcConnection.ParameterResultSetConsumer, io.debezium.jdbc.JdbcConnection.ResultSetConsumer, io.debezium.jdbc.JdbcConnection.ResultSetMapper<T>, io.debezium.jdbc.JdbcConnection.StatementFactory, io.debezium.jdbc.JdbcConnection.StatementPreparer| Modifier and Type | Field and Description |
|---|---|
private static String |
CDC_SCHEMA |
private static int |
CHANGE_TABLE_DATA_COLUMN_OFFSET |
private static io.debezium.jdbc.JdbcConnection.ConnectionFactory |
FACTORY |
private static String |
GET_ALL_CHANGES_FOR_TABLE |
private static String |
GET_DATABASE_NAME |
private static String |
GET_LIST_OF_CDC_ENABLED_TABLES |
private static String |
GET_LIST_OF_KEY_COLUMNS |
private static String |
GET_LIST_OF_NEW_CDC_ENABLED_TABLES |
private static String |
GET_MAX_LSN |
private static String |
LOCK_TABLE |
private static org.slf4j.Logger |
LOGGER |
private static String |
LSN_TO_TIMESTAMP |
private io.debezium.util.BoundedConcurrentHashMap<Lsn,Instant> |
lsnToInstantCache |
private String |
realDatabaseName
actual name of the database, which could differ in casing from the database name given in the connector config.
|
private static String |
STATEMENTS_PLACEHOLDER |
private static String |
URL_PATTERN |
| Constructor and Description |
|---|
Db2Connection(io.debezium.config.Configuration config)
Creates a new connection using the supplied configuration.
|
| Modifier and Type | Method and Description |
|---|---|
private String |
cdcNameForTable(io.debezium.relational.TableId tableId) |
void |
getChangesForTable(io.debezium.relational.TableId tableId,
Lsn fromLsn,
Lsn toLsn,
io.debezium.jdbc.JdbcConnection.ResultSetConsumer consumer)
Provides all changes recorded by the DB2 CDC capture process for a given table.
|
void |
getChangesForTables(Db2ChangeTable[] changeTables,
Lsn intervalFromLsn,
Lsn intervalToLsn,
io.debezium.jdbc.JdbcConnection.BlockingMultiResultSetConsumer consumer)
Provides all changes recorder by the DB2 CDC capture process for a set of tables.
|
Lsn |
getMaxLsn() |
String |
getNameOfChangeTable(String captureName) |
String |
getRealDatabaseName() |
io.debezium.relational.Table |
getTableSchemaFromChangeTable(Db2ChangeTable changeTable) |
io.debezium.relational.Table |
getTableSchemaFromTable(Db2ChangeTable changeTable) |
Lsn |
incrementLsn(Lsn lsn)
Obtain the next available position in the database log.
|
protected boolean |
isTableUniqueIndexIncluded(String indexName,
String columnName) |
Set<Db2ChangeTable> |
listOfChangeTables() |
Set<Db2ChangeTable> |
listOfNewChangeTables(Lsn fromLsn,
Lsn toLsn) |
void |
lockTable(io.debezium.relational.TableId tableId)
Creates an exclusive lock for a given table.
|
private String |
retrieveRealDatabaseName() |
Instant |
timestampOfLsn(Lsn lsn)
Map a commit LSN to a point in time when the commit happened.
|
call, close, commit, config, connect, connection, connection, connectionString, database, execute, execute, executeWithoutCommitting, getDefaultValue, isConnected, isNullable, 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 final String GET_DATABASE_NAME
private static org.slf4j.Logger LOGGER
private static final String CDC_SCHEMA
private static final String STATEMENTS_PLACEHOLDER
private static final String GET_MAX_LSN
private static final String LOCK_TABLE
private static final String LSN_TO_TIMESTAMP
private static final String GET_ALL_CHANGES_FOR_TABLE
private static final String GET_LIST_OF_CDC_ENABLED_TABLES
private static final String GET_LIST_OF_NEW_CDC_ENABLED_TABLES
private static final String GET_LIST_OF_KEY_COLUMNS
private static final int CHANGE_TABLE_DATA_COLUMN_OFFSET
private static final String URL_PATTERN
private static final io.debezium.jdbc.JdbcConnection.ConnectionFactory FACTORY
private final String realDatabaseName
public Db2Connection(io.debezium.config.Configuration config)
config - Configuration instance, may not be null.public Lsn getMaxLsn() throws SQLException
SQLExceptionpublic void getChangesForTable(io.debezium.relational.TableId tableId,
Lsn fromLsn,
Lsn toLsn,
io.debezium.jdbc.JdbcConnection.ResultSetConsumer consumer)
throws SQLException
tableId - - the requested table changesfromLsn - - closed lower bound of interval of changes to be providedtoLsn - - closed upper bound of interval of changes to be providedconsumer - - the change processorSQLExceptionpublic void getChangesForTables(Db2ChangeTable[] changeTables, Lsn intervalFromLsn, Lsn intervalToLsn, io.debezium.jdbc.JdbcConnection.BlockingMultiResultSetConsumer consumer) throws SQLException, InterruptedException
changeTables - - the requested tables to obtain changes forintervalFromLsn - - closed lower bound of interval of changes to be providedintervalToLsn - - closed upper bound of interval of changes to be providedconsumer - - the change processorSQLExceptionInterruptedExceptionpublic Lsn incrementLsn(Lsn lsn) throws SQLException
lsn - - LSN of the current positionSQLExceptionpublic Instant timestampOfLsn(Lsn lsn) throws SQLException
lsn - - LSN of the commitSQLExceptionpublic void lockTable(io.debezium.relational.TableId tableId)
throws SQLException
tableId - to be lockedSQLExceptionprivate String cdcNameForTable(io.debezium.relational.TableId tableId)
public Set<Db2ChangeTable> listOfChangeTables() throws SQLException
SQLExceptionpublic Set<Db2ChangeTable> listOfNewChangeTables(Lsn fromLsn, Lsn toLsn) throws SQLException
SQLExceptionpublic io.debezium.relational.Table getTableSchemaFromTable(Db2ChangeTable changeTable) throws SQLException
SQLExceptionpublic io.debezium.relational.Table getTableSchemaFromChangeTable(Db2ChangeTable changeTable) throws SQLException
SQLExceptionpublic String getRealDatabaseName()
protected boolean isTableUniqueIndexIncluded(String indexName, String columnName)
isTableUniqueIndexIncluded in class io.debezium.jdbc.JdbcConnectionprivate String retrieveRealDatabaseName()
Copyright © 2021 JBoss by Red Hat. All rights reserved.