Skip to content

Commit

Permalink
Correct prepared statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvind-wedoe committed Dec 19, 2024
1 parent 14eb3c6 commit 07eeb89
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ class V168__dvh_pesys_fix_migrated_anker : BaseJavaMigration() {
"""
update klage.kafka_event
set json_payload = ?
and status_id = ?
where id = ?
""".trimIndent()
)

context.connection.createStatement().use { select ->
select.executeQuery(
"""
select ke.id, ke.json_payload, ke.status_id
select ke.id, ke.json_payload
from klage.kafka_event ke
where ke.type = 'STATS_DVH'
and ke.kilde_referanse in (
Expand Down Expand Up @@ -59,8 +60,8 @@ class V168__dvh_pesys_fix_migrated_anker : BaseJavaMigration() {
}

preparedStatement.setString(1, ourJacksonObjectMapper().writeValueAsString(modifiedVersion))
preparedStatement.setObject(2, kafkaEventId)
preparedStatement.setObject(3,"IKKE_SENDT")
preparedStatement.setObject(2,"IKKE_SENDT")
preparedStatement.setObject(3, kafkaEventId)

preparedStatement.executeUpdate()
}
Expand Down

0 comments on commit 07eeb89

Please sign in to comment.