From: Oliver Jowett <oliver@opencloud.com>
To: Elie Nacache <elie_nacache@yahoo.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [GENERAL] Resultset problem or BUG !
Date: Thu, 12 Aug 2004 17:41:18 +1200
Message-ID: <411B02FE.6060600@opencloud.com> (raw)
In-Reply-To: <20040811145310.37997.qmail@web54102.mail.yahoo.com>
References: <20040811145310.37997.qmail@web54102.mail.yahoo.com>
Elie Nacache wrote:
> this.sqlDatas.moveToInsertRow();
> this.updateColumns();
> this.sqlDatas.insertRow();
The JDBC javadoc implies that calling insertRow() leaves the resultset
on the insert row. This is what the driver implements.
> this.sqlLineNumber = this.sqlDatas.getRow(); // INFO >> return 0
As the javadoc says, getRow() returns 0 if there is no current row.
You're on the insert row so there is no current row.
> INFO >> At this step there is no commit
> INFO >> Second step update the row after collecting updated info
>
> this.sqlDatas.absolute(this.sqlLineNumber); // INFO >> throw the
> exception
What is the exception you see?
The current development driver (see jdbc.postgresql.org) will treat
absolute(0) as if you'd called beforeFirst(). Older drivers might do
something different.
> this.updateColumns();
> this.sqlDatas.updateRow();
> INFO >> If I fix the sqlLineNumber to 1 and force the absolute(1)
> then no Execption is thrown but the modification is not seen in the
> table.
Looking at the driver source, it looks like the newly inserted row is
appended to the resultset, so you should find it at the end of the
resultset not the start. (I don't think making this assumption is
portable, though).
-O
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, elie_nacache@yahoo.com
Subject: Re: [GENERAL] Resultset problem or BUG !
In-Reply-To: <411B02FE.6060600@opencloud.com>
References: <20040811145310.37997.qmail@web54102.mail.yahoo.com> <411B02FE.6060600@opencloud.com>
* 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