kafka connect源连接器不适用于db2

aoyhnmkz  于 2021-06-08  发布在  Kafka
关注(0)|答案(0)|浏览(263)

当我在mysql上运行kafka connect source connector时,一切运行正常,我使用的是时间戳策略,当我尝试使用不同的数据库时,问题出现了,在我的示例中,我尝试从db2表获取信息,当我执行连接器时,我得到以下错误:

ERROR Failed to get current time from DB using query select CURRENT_TIMESTAMP; on database DB2 (io.confluent.connect.jdbc.util.JdbcUtils:263)
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=<END-OF-STATEMENT>;( CONCAT || / MICROSECONDS MICROSECOND SECONDS SECO, DRIVER=4.21.29

我认为它没有检测到数据库,而是试图执行查询:select current\u timestamp
而且它在db2中不起作用,所以我们需要指定数据库,有没有办法指定驱动程序类或我们正在使用的数据库?
编辑
----我的连接器配置

{
    "name": "test2-conn",
    "config": 
    {
        "mode":"timestamp",
        "debug":true,
        "poll.interval.ms":10000,
        "timestamp.delay.interval.ms":60000,
        "timestamp.column.name":"LAST_UPDATE_TIME",
        "incrementing.column.name":"id",
        "connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector" ,
        "connection.url":"jdbc:db2://url:port/db:currentSchema=schema",
        "connection.password":"psswd",
        "connection.user":"user",
        "table.types":"VIEW",
        "table.whitelist":"my_view",
        "tasks.max":"1",
        "topic.prefix":"gta-tors-platform",
        "value.converter": "org.apache.kafka.connect.json.JsonConverter",
        "key.converter":"org.apache.kafka.connect.storage.StringConverter",
        "key.converter.schemas.enable":false,
        "value.converter.schemas.enable":false,
        "transforms":"createKey",
        "transforms.createKey.type":"org.apache.kafka.connect.transforms.ValueToKey",
        "transforms.createKey.fields":"EMP_NAME"
        }
}

我使用的是z/osdb2v11.1模式nfm
谢谢你的帮助

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题