Skip site navigation (1) Skip section navigation (2)

jdbc - number of updated rows

From: Piotr Stelmaszyk <kelman(at)fanthom(dot)math(dot)put(dot)poznan(dot)pl>
To: PgSQL-interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: jdbc - number of updated rows
Date: 1999-05-22 10:35:10
Message-ID: (view raw or whole thread)
Lists: pgsql-interfaces
Please tell me how to get to know how many rows has method
executeUpdate affected. According to documentation
        either the row count for INSERT, UPDATE or DELETE ...
this method should return number of updated rows, but it always
returns 1. It's a feature(bug) of postgresql jdbc-driver?

The only solution for my problem, that I made up is:

turn off auto-commit

select count(*) from table
where tID=5
-- now i (probably)know number of updated rows

update table set ...
where tID=5


turn on auto-commit
-- stupid, isn't it ...

PS. remember that I'm new here...

/- Piotr Stelmaszyk |---- Student of Computer Science ---/
/------------------ | at Poznan University of Technology /
/----- mailto:kelman(at)fanthom(dot)math(dot)put(dot)poznan(dot)pl ---------/
/----- mailto:kelman(at)alpha(dot)net(dot)pl -----------------------/

pgsql-interfaces by date

Next:From: Peter GarnerDate: 1999-05-22 11:36:47
Subject: Error with JDBC
Previous:From: Piotr StelmaszykDate: 1999-05-22 10:24:28
Subject: jdbc - getArray

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group