# Db2 CDC Connector The Db2 CDC connector allows for reading snapshot data and incremental data from Db2 database. This document describes how to setup the db2 CDC connector to run SQL queries against Db2 databases. ## Supported Databases | Connector | Database | Driver | |-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------| | [Db2-cdc](db2-cdc.md) |
Option | Required | Default | Type | Description |
---|---|---|---|---|
connector | required | (none) | String | Specify what connector to use, here should be 'db2-cdc' . |
hostname | required | (none) | String | IP address or hostname of the Db2 database server. |
username | required | (none) | String | Name of the Db2 database to use when connecting to the Db2 database server. |
password | required | (none) | String | Password to use when connecting to the Db2 database server. |
database-name | required | (none) | String | Database name of the Db2 server to monitor. |
schema-name | required | (none) | String | Schema name of the Db2 database to monitor. |
table-name | required | (none) | String | Table name of the Db2 database to monitor. |
port | optional | 50000 | Integer | Integer port number of the Db2 database server. |
scan.startup.mode | optional | initial | String | Optional startup mode for Db2 CDC consumer, valid enumerations are "initial" and "latest-offset". Please see Startup Reading Position section for more detailed information. |
server-time-zone | optional | (none) | String | The session time zone in database server, e.g. "Asia/Shanghai". It controls how the TIMESTAMP type in Db2 converted to STRING. See more here. If not set, then ZoneId.systemDefault() is used to determine the server time zone. |
debezium.* | optional | (none) | String | Pass-through Debezium's properties to Debezium Embedded Engine which is used to capture data changes from
Db2 server.
For example: 'debezium.snapshot.mode' = 'never' .
See more about the Debezium's Db2 Connector properties |
Db2 type | Flink SQL type | NOTE |
---|---|---|
SMALLINT |
SMALLINT | |
INTEGER | INT | |
BIGINT | BIGINT | |
REAL | FLOAT | |
DOUBLE | DOUBLE | |
NUMERIC(p, s) DECIMAL(p, s) |
DECIMAL(p, s) | |
DATE | DATE | |
TIME | TIME | |
TIMESTAMP [(p)] | TIMESTAMP [(p)] | |
CHAR(n) | CHAR(n) | |
VARCHAR(n) | VARCHAR(n) | |
BINARY(n) | BINARY(n) | |
VARBINARY(N) | VARBINARY(N) | |
BLOB CLOB DBCLOB |
BYTES | |
VARGRAPHIC XML |
STRING |