When I run kafka connect source connector on MySQL everything runs fine, I'm working with the timestamp strategy, the problem comes when I try to do it with a different database, in my case I'm trying to get the information from a db2 table, when I execute my connector I get the following error:
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
I think it is not detecting the database and it is trying to execute the query: select CURRENT_TIMESTAMP
And it doesn't work in db2, so we need to specify the database, is there a way to specify the Driver class or the database we are using ?
EDIT
----My connector configuration
{
"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"
}
}
I'm using I'm using z/OS DB2 V11.1 mode NFM
Thanks for your help