Re: getUdateCount() vs. RETURNING clause

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: getUdateCount() vs. RETURNING clause
Date: 2009-11-25 12:30:17
Message-ID: hej80d$h7p$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Oliver Jowett, 25.11.2009 13:16:
>> So if I create a loop using the condition stated in the Javadocs the
>> program flow would be as follows:
>>
>> 1) stmt.execute() returns true, so I call getResultSet()
>> 2) getMoreResults() returns false, but getUpdateCount() returns 3 ==> go on
>> 3) getMoreResults() returns false, but getUpdateCount() returns 2 ==> go on
>> 4) getMoreResults() returns true, so getResultSet() returns a result set
>> ==> go on
>> 5) getMoreResults() returns true, so getResultSet() returns a result set
>> ==> go on
>> 6) getMoreResults() returns false, getUpdateCount() returns -1 ==>
>> everything was processed.
>
> Yes, this is correct. It will look something like this:

So my understanding was correct ;)

Back to my original question then: why doesn't the Postgres driver return 1 as the updateCount in this situation?

I only get a single result set (which is correct) but never a 1 as the update count.

Regards
Thomas

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2009-11-25 13:14:24 Re: getUdateCount() vs. RETURNING clause
Previous Message Oliver Jowett 2009-11-25 12:16:20 Re: getUdateCount() vs. RETURNING clause