public class Db2Connection
extends io.debezium.jdbc.JdbcConnection
JdbcConnection
extension to be used with IBM Db2Modifier and Type | Class and Description |
---|---|
static class |
Db2Connection.CdcEnabledTable |
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.ResultSetExtractor<T>, io.debezium.jdbc.JdbcConnection.ResultSetMapper<T>, io.debezium.jdbc.JdbcConnection.StatementFactory, io.debezium.jdbc.JdbcConnection.StatementPreparer
Constructor and Description |
---|
Db2Connection(io.debezium.jdbc.JdbcConfiguration config)
Creates a new connection using the supplied configuration.
|
Modifier and Type | Method and Description |
---|---|
String |
connectionString()
Returns a JDBC connection string for the current configuration.
|
void |
getChangesForTable(io.debezium.relational.TableId tableId,
io.debezium.connector.db2.Lsn fromLsn,
io.debezium.connector.db2.Lsn toLsn,
io.debezium.jdbc.JdbcConnection.ResultSetConsumer consumer)
Provides all changes recorded by the DB2 CDC capture process for a given table.
|
void |
getChangesForTables(io.debezium.connector.db2.Db2ChangeTable[] changeTables,
io.debezium.connector.db2.Lsn intervalFromLsn,
io.debezium.connector.db2.Lsn intervalToLsn,
io.debezium.jdbc.JdbcConnection.BlockingMultiResultSetConsumer consumer)
Provides all changes recorder by the DB2 CDC capture process for a set of tables.
|
Optional<Timestamp> |
getCurrentTimestamp() |
io.debezium.connector.db2.Lsn |
getMaxLsn() |
String |
getNameOfChangeTable(String captureName) |
String |
getRealDatabaseName() |
io.debezium.relational.Table |
getTableSchemaFromChangeTable(io.debezium.connector.db2.Db2ChangeTable changeTable) |
io.debezium.relational.Table |
getTableSchemaFromTable(io.debezium.connector.db2.Db2ChangeTable changeTable) |
io.debezium.connector.db2.Lsn |
incrementLsn(io.debezium.connector.db2.Lsn lsn)
Obtain the next available position in the database log.
|
protected boolean |
isTableUniqueIndexIncluded(String indexName,
String columnName) |
Set<io.debezium.connector.db2.Db2ChangeTable> |
listOfChangeTables() |
Set<io.debezium.connector.db2.Db2ChangeTable> |
listOfNewChangeTables(io.debezium.connector.db2.Lsn fromLsn,
io.debezium.connector.db2.Lsn toLsn) |
void |
lockTable(io.debezium.relational.TableId tableId)
Creates an exclusive lock for a given table.
|
String |
quotedTableIdString(io.debezium.relational.TableId tableId) |
List<String> |
readPrimaryKeyNames(DatabaseMetaData metadata,
io.debezium.relational.TableId id) |
Set<io.debezium.relational.TableId> |
readTableNames(String databaseCatalog,
String schemaNamePattern,
String tableNamePattern,
String[] tableTypes)
Get the identifiers of the tables.
|
List<String> |
readTableUniqueIndices(DatabaseMetaData metadata,
io.debezium.relational.TableId id) |
protected String |
resolveCatalogName(String catalogName) |
java.time.Instant |
timestampOfLsn(io.debezium.connector.db2.Lsn lsn)
Map a commit LSN to a point in time when the commit happened.
|
buildSelectWithRowLimits, call, close, commit, config, connect, connection, connection, connectionString, database, execute, execute, executeWithoutCommitting, getColumnsDetails, getColumnValue, isConnected, isNullable, isTableType, isValid, loadKeyStore, overrideColumn, parseSqlStatementString, patternBasedFactory, patternBasedFactory, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQueryAndMap, prepareQueryWithBlockingConsumer, prepareUpdate, print, print, query, query, queryAndMap, queryAndMap, querySingleValue, queryWithBlockingConsumer, quotedColumnIdString, readAllCatalogNames, readAllSchemaNames, readAllTableNames, readPrimaryKeyOrUniqueIndexNames, readSchema, readTableColumn, readTablePreparedStatement, readTableStatement, resolveJdbcType, resolveNativeType, rollback, rowToArray, setAutoCommit, singleResultMapper, supportedTableTypes, tableTypes, username
public Db2Connection(io.debezium.jdbc.JdbcConfiguration config)
config
- Configuration
instance, may not be null.public io.debezium.connector.db2.Lsn getMaxLsn() throws SQLException
SQLException
public void getChangesForTable(io.debezium.relational.TableId tableId, io.debezium.connector.db2.Lsn fromLsn, io.debezium.connector.db2.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 processorSQLException
public void getChangesForTables(io.debezium.connector.db2.Db2ChangeTable[] changeTables, io.debezium.connector.db2.Lsn intervalFromLsn, io.debezium.connector.db2.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 processorSQLException
InterruptedException
public io.debezium.connector.db2.Lsn incrementLsn(io.debezium.connector.db2.Lsn lsn) throws SQLException
lsn
- - LSN of the current positionSQLException
public java.time.Instant timestampOfLsn(io.debezium.connector.db2.Lsn lsn) throws SQLException
lsn
- - LSN of the commitSQLException
public Optional<Timestamp> getCurrentTimestamp() throws SQLException
getCurrentTimestamp
in class io.debezium.jdbc.JdbcConnection
SQLException
public void lockTable(io.debezium.relational.TableId tableId) throws SQLException
tableId
- to be lockedSQLException
public Set<io.debezium.connector.db2.Db2ChangeTable> listOfChangeTables() throws SQLException
SQLException
public Set<io.debezium.connector.db2.Db2ChangeTable> listOfNewChangeTables(io.debezium.connector.db2.Lsn fromLsn, io.debezium.connector.db2.Lsn toLsn) throws SQLException
SQLException
public io.debezium.relational.Table getTableSchemaFromTable(io.debezium.connector.db2.Db2ChangeTable changeTable) throws SQLException
SQLException
public io.debezium.relational.Table getTableSchemaFromChangeTable(io.debezium.connector.db2.Db2ChangeTable changeTable) throws SQLException
SQLException
public String getRealDatabaseName()
protected boolean isTableUniqueIndexIncluded(String indexName, String columnName)
isTableUniqueIndexIncluded
in class io.debezium.jdbc.JdbcConnection
public String connectionString()
String
where the variables in urlPattern
are replaced with values
from the configurationpublic String quotedTableIdString(io.debezium.relational.TableId tableId)
quotedTableIdString
in class io.debezium.jdbc.JdbcConnection
protected String resolveCatalogName(String catalogName)
resolveCatalogName
in class io.debezium.jdbc.JdbcConnection
public List<String> readPrimaryKeyNames(DatabaseMetaData metadata, io.debezium.relational.TableId id) throws SQLException
readPrimaryKeyNames
in class io.debezium.jdbc.JdbcConnection
SQLException
public List<String> readTableUniqueIndices(DatabaseMetaData metadata, io.debezium.relational.TableId id) throws SQLException
readTableUniqueIndices
in class io.debezium.jdbc.JdbcConnection
SQLException
public Set<io.debezium.relational.TableId> readTableNames(String databaseCatalog, String schemaNamePattern, String tableNamePattern, String[] tableTypes) throws SQLException
readTableNames
in class io.debezium.jdbc.JdbcConnection
databaseCatalog
- the name of the catalog, which is typically the database name; may be
an empty string for tables that have no catalog, or null
if the catalog name
should not be used to narrow the list of table identifiersschemaNamePattern
- the pattern used to match database schema names, which may be "" to
match only those tables with no schema or null
if the schema name should not be
used to narrow the list of table identifierstableNamePattern
- the pattern used to match database table names, which may be null to
match all table namestableTypes
- the set of table types to include in the results, which may be null for all
table typesTableId
s; never null but possibly emptySQLException
- if an error occurs while accessing the database metadataCopyright © 2024 The Apache Software Foundation. All rights reserved.