# JDBC Connector - differentiating between create and updates

**URL:** <https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512>\
**Category:** Self-Managed Connectors\
**Created:** [12 November 2022 00:21 UTC](https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512 "2022-11-12T00:21:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![obelix74](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/obelix74/32/2546_2.png) [@obelix74](https://forum.confluent.io/u/obelix74)\
**Post date:** [12 November 2022 00:21 UTC](https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512/1 "2022-11-12T00:21:56Z")

</div>

I am using the JDBC connector. From the payload of updates from the Kafka topic used in “timestamp+incrementing” mode, how can I differentiate between creates and updates in the database?

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [12 November 2022 13:08 UTC](https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512/2 "2022-11-12T13:08:10Z")

</div>

hey @obelix74

welcome to the forum 🙂

I guess we are talking about the jdbc sink connector?

best,  
michael

---

<div class="post-metadata">

**Author:** ![obelix74](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/obelix74/32/2546_2.png) [@obelix74](https://forum.confluent.io/u/obelix74)\
**Post date:** [12 November 2022 15:16 UTC](https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512/3 "2022-11-12T15:16:33Z")

</div>

Hi @mmuehlbeyer

Thanks. No, I was talking about the JDBC source connector.

> **[JDBC Source Connector for Confluent Platform | Confluent Documentation](https://docs.confluent.io/kafka-connectors/jdbc/current/source-connector/index.html)**
>
> Get started with the JDBC Source connector for Confluent Platform.

I have a MariaDB database and I configured the source connector to monitor a database and publish the change events to a Kafka topic.

When I look at the payload from the Kafka topic, I can’t tell if it was a CREATE or an UPDATE.

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [14 November 2022 07:02 UTC](https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512/4 "2022-11-14T07:02:31Z")

</div>

understood  
afaik it’s not possible see

> <https://stackoverflow.com/questions/64155788/kafka-jdbc-source-connector-insert-or-update>

best,  
michael

---

<div class="post-metadata">

**Author:** ![OneCricketeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/onecricketeer/32/1551_2.png) [@OneCricketeer](https://forum.confluent.io/u/OneCricketeer)\
**Post date:** [24 November 2022 04:33 UTC](https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512/5 "2022-11-24T04:33:06Z")

</div>

Use Debezium instead. It’ll include an op field in the records that indicates updates, inserts, as well as deletes.

Otherwise, capture all records in a KTable, then check if a key already exists. If so, it’s an update.

---

<div class="post-metadata">

**Author:** ![obelix74](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/obelix74/32/2546_2.png) [@obelix74](https://forum.confluent.io/u/obelix74)\
**Post date:** [24 November 2022 15:15 UTC](https://forum.confluent.io/t/jdbc-connector-differentiating-between-create-and-updates/6512/6 "2022-11-24T15:15:15Z")

</div>

Hi Jordan

Thanks, I am working on Debezium as well. I need to work with MariaDB + Bitemporal data and Debezium currently does not support that. I am working on an experimental PR on Debezium to support that at the moment.
