Skip site navigation (1) Skip section navigation (2)

"org.postgresql.util.PSQLException: This ResultSet is closed" in call to rst.getString(..)

From: Russ Tennant <russ(at)i2rd(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: "org.postgresql.util.PSQLException: This ResultSet is closed" in call to rst.getString(..)
Date: 2005-10-05 22:18:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
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 returns true in this case. Any help would be appreciated. Thanks.

Server Version = 8.0.3
JDBC Driver Version = 8.0 Build 312

Code that causes exception:

ResultSet rstVersionColumns=meta.getVersionColumns(null, null, tableName);
while (
    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(
	at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(
	at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(

Russ Tennant


pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-10-05 22:38:00
Subject: Re: "org.postgresql.util.PSQLException: This ResultSet is
Previous:From: Marc HerbertDate: 2005-10-05 14:22:37
Subject: Re: Selecting on non ASCII varchars

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group