pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
To: PgSQL-interfaces <pgsql-interfaces@postgresql.org>
Subject: jdbc - number of updated rows
Date: Sat, 22 May 1999 12:35:10 +0200
Message-ID: <11524.990522@fanthom.math.put.poznan.pl> (raw)

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 -----------------------/
/--------------------------------------------------------/





view thread (2+ messages)  latest in thread

Message-ID: <11524.990522@fanthom.math.put.poznan.pl>
Permalink:  ../11524.990522@fanthom.math.put.poznan.pl/
Also on:    postgresql.org/message-id/11524.990522@fanthom.math.put.poznan.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: kelman@fanthom.math.put.poznan.pl
  Subject: Re: jdbc - number of updated rows
  In-Reply-To: <11524.990522@fanthom.math.put.poznan.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox