why does executeUpdate return 1 even if no new row has been inserted?

前端 未结 2 1365
一生所求
一生所求 2021-01-21 08:02

here is my very simple table (Postgres):

CREATE TABLE IF NOT EXISTS PERFORMANCE.TEST
(
test text NOT NULL UNIQUE
);

if I try to insert a String

2条回答
  •  悲&欢浪女
    2021-01-21 08:12

    that was missing:

    conn.commit();
    

    (after the executeUpdate())

    actually a new row was inserted but the DB rolled back immediately.

提交回复
热议问题