From: Russ Tennant <russ@i2rd.com>
To: pgsql-jdbc@postgresql.org
Subject: "org.postgresql.util.PSQLException: This ResultSet is closed" in call to rst.getString(..)
Date: Wed, 5 Oct 2005 17:18:20 -0500
Message-ID: <200510051718.20776.russ@i2rd.com> (raw)
The following code throws an Exception with the postgresql jdbc driver. This code does work with the MySQL and HSQL JDBC drivers and it looks correct to me. The call to getString(..) is what is causing the exception. It appears the result set is considered closed even though ResultSet.next() returns true in this case. Any help would be appreciated. Thanks.
Info:
Server Version = 8.0.3
JDBC Driver Version = 8.0 Build 312
Code that causes exception:
ResultSet rstVersionColumns=meta.getVersionColumns(null, null, tableName);
while (rstVersionColumns.next())
{
String fieldName=rstColumn.getString("COLUMN_NAME"); // Exception thrown here
if (_logger.isDebugEnabled())
_logger.debug("Version field "+fieldName);
// [snip]
}
Partial Stack Trace
Caused by: org.postgresql.util.PSQLException: This ResultSet is closed.
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkClosed(AbstractJdbc2ResultSet.java:2457)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2358)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2203)
--
Russ Tennant
russ@i2rd.com
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: russ@i2rd.com
Subject: Re: "org.postgresql.util.PSQLException: This ResultSet is closed" in call to rst.getString(..)
In-Reply-To: <200510051718.20776.russ@i2rd.com>
References: <200510051718.20776.russ@i2rd.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