public class SqlServerConnection
extends io.debezium.jdbc.JdbcConnection
JdbcConnection extension to be used with Microsoft SQL Server| Modifier and Type | Class and Description |
|---|---|
static class |
SqlServerConnection.CdcEnabledTable |
private static interface |
SqlServerConnection.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 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_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 |
INCREMENT_LSN |
private static String |
LOCK_TABLE |
private static org.slf4j.Logger |
LOGGER |
private static String |
LSN_TO_TIMESTAMP |
private static String |
STATEMENTS_PLACEHOLDER |
private static String |
URL_PATTERN |
| Constructor and Description |
|---|
SqlServerConnection(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 SQL Server CDC capture process for a given table.
|
void |
getChangesForTables(ChangeTable[] changeTables,
Lsn intervalFromLsn,
Lsn intervalToLsn,
io.debezium.jdbc.JdbcConnection.BlockingMultiResultSetConsumer consumer)
Provides all changes recorder by the SQL Server CDC capture process for a set of tables.
|
Lsn |
getMaxLsn() |
String |
getNameOfChangeTable(String captureName) |
io.debezium.relational.Table |
getTableSchemaFromChangeTable(ChangeTable changeTable) |
io.debezium.relational.Table |
getTableSchemaFromTable(ChangeTable changeTable) |
Lsn |
incrementLsn(Lsn lsn)
Obtain the next available position in the database log.
|
Set<ChangeTable> |
listOfChangeTables() |
Set<ChangeTable> |
listOfNewChangeTables(Lsn fromLsn,
Lsn toLsn) |
void |
lockTable(io.debezium.relational.TableId tableId)
Creates an exclusive lock for a given table.
|
void |
rollback() |
private <T> io.debezium.jdbc.JdbcConnection.ResultSetMapper<T> |
singleResultMapper(SqlServerConnection.ResultSetExtractor<T> extractor,
String error) |
Instant |
timestampOfLsn(Lsn lsn)
Map a commit LSN to a point in time when the commit happened.
|
call, close, columnsFor, columnsFor, config, connect, connection, connection, connectionString, database, execute, execute, isConnected, parseSqlStatementString, patternBasedFactory, patternBasedFactory, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQueryAndMap, prepareUpdate, print, print, query, query, queryAndMap, queryAndMap, queryWithBlockingConsumer, readAllCatalogNames, readAllSchemaNames, readAllTableNames, readPrimaryKeyNames, readSchema, readTableColumn, readTableNames, resolveNativeType, setAutoCommit, tableTypes, usernameprivate static org.slf4j.Logger LOGGER
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 INCREMENT_LSN
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
public SqlServerConnection(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(ChangeTable[] 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)
private <T> io.debezium.jdbc.JdbcConnection.ResultSetMapper<T> singleResultMapper(SqlServerConnection.ResultSetExtractor<T> extractor, String error) throws SQLException
SQLExceptionpublic Set<ChangeTable> listOfChangeTables() throws SQLException
SQLExceptionpublic Set<ChangeTable> listOfNewChangeTables(Lsn fromLsn, Lsn toLsn) throws SQLException
SQLExceptionpublic io.debezium.relational.Table getTableSchemaFromTable(ChangeTable changeTable) throws SQLException
SQLExceptionpublic io.debezium.relational.Table getTableSchemaFromChangeTable(ChangeTable changeTable) throws SQLException
SQLExceptionpublic void rollback()
throws SQLException
SQLExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.