jdbc - number of updated rows - Mailing list pgsql-interfaces

From Piotr Stelmaszyk
Subject jdbc - number of updated rows
Date
Msg-id 11524.990522@fanthom.math.put.poznan.pl
Whole thread Raw
List pgsql-interfaces
Please tell me how to get to know how many rows has method
executeUpdate affected. According to documentation
<cut>
Returns:       either the row count for INSERT, UPDATE or DELETE ...
</cut>
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

commit

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@fanthom.math.put.poznan.pl ---------/
/----- mailto:kelman@alpha.net.pl -----------------------/
/--------------------------------------------------------/




pgsql-interfaces by date:

Previous
From: Piotr Stelmaszyk
Date:
Subject: jdbc - getArray
Next
From: Peter Garner
Date:
Subject: Error with JDBC