X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 50F69DA25F for ; Wed, 5 Oct 2005 19:17:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47835-06 for ; Wed, 5 Oct 2005 22:17:23 +0000 (GMT) Received: from ms-smtp-01.rdc-kc.rr.com (ms-smtp-01.rdc-kc.rr.com [24.94.166.115]) by svr1.postgresql.org (Postfix) with ESMTP id 892E9DA22D for ; Wed, 5 Oct 2005 19:17:23 -0300 (ADT) Received: from russ.internal.i2rd.com (rrcs-67-53-27-98.west.biz.rr.com [67.53.27.98]) by ms-smtp-01.rdc-kc.rr.com (8.12.10/8.12.7) with ESMTP id j95MH1Z7008413 for ; Wed, 5 Oct 2005 17:17:02 -0500 (CDT) From: Russ Tennant Organization: I2RD 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 User-Agent: KMail/1.8.2 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4139224.qBODZSKHiP"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200510051718.20776.russ@i2rd.com> X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.137 required=5 tests=[FORGED_RCVD_HELO=0.05, HTML_40_50=0.086, HTML_MESSAGE=0.001] X-Spam-Level: X-Archive-Number: 200510/20 X-Sequence-Number: 13951 --nextPart4139224.qBODZSKHiP Content-Type: multipart/alternative; boundary="Boundary-00=_sEFRDyvT47gGZFN" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-00=_sEFRDyvT47gGZFN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The following code throws an Exception with the postgresql jdbc driver. Thi= s 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 appea= rs the result set is considered closed even though ResultSet.next() returns= true in this case. Any help would be appreciated. Thanks. Info: Server Version =3D 8.0.3 JDBC Driver Version =3D 8.0 Build 312 Code that causes exception: ResultSet rstVersionColumns=3Dmeta.getVersionColumns(null, null, tableName); while (rstVersionColumns.next()) { String fieldName=3DrstColumn.getString("COLUMN_NAME"); // Exception thr= own 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(AbstractJdbc2Re= sultSet.java:2457) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2Res= ultSet.java:2358) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2Resu= ltSet.java:2203) =2D-=20 Russ Tennant russ@i2rd.com --Boundary-00=_sEFRDyvT47gGZFN Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit

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

--Boundary-00=_sEFRDyvT47gGZFN-- --nextPart4139224.qBODZSKHiP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD4DBQBDRFEsF1PNCHnhVNURAnofAJUdvS2B1yn2ZBan4gHBp0sCZwXRAJ0SDTOM nrxEPuREsNlwNIYpH/msgg== =eW8p -----END PGP SIGNATURE----- --nextPart4139224.qBODZSKHiP--