From: Oliver Jowett <oliver@opencloud.com>
To: Nahum Castro <nahumcastro@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: next() error
Date: Fri, 04 Feb 2005 12:05:12 +1300
Message-ID: <4202AE28.2080300@opencloud.com> (raw)
In-Reply-To: <714bb51a050203145120066735@mail.gmail.com>
References: <714bb51a050203145120066735@mail.gmail.com>
Nahum Castro wrote:
> javax.servlet.ServletException: ResultSet not positioned properly,
> perhaps you need to call next.
> Has changed something on the server or on the driver?
Newer drivers follow the JDBC specification more strictly.
> ResultSet RecordsetPubs1 = StatementRecordsetPubs1.executeQuery();
> boolean RecordsetPubs1_isEmpty = ! RecordsetPubs1.next();
> boolean RecordsetPubs1_hasData = ! RecordsetPubs1_isEmpty;
[...]
> <td align="left" width="50%"><%=(((RecordsetPubs1_data =
> RecordsetPubs1.getObject("au_id"))==null ||
> RecordsetPubs1.wasNull())?"":RecordsetPubs1_data)%></td>
You appear to be calling ResultSet.getObject() even if ResultSet.next()
returned false. You're not allowed to do this -- see the JDBC javadoc.
-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, nahumcastro@gmail.com
Subject: Re: next() error
In-Reply-To: <4202AE28.2080300@opencloud.com>
References: <714bb51a050203145120066735@mail.gmail.com> <4202AE28.2080300@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