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

Поиск
Список
Период
Сортировка
От Russ Tennant
Тема "org.postgresql.util.PSQLException: This ResultSet is closed" in call to rst.getString(..)
Дата
Msg-id 200510051718.20776.russ@i2rd.com
обсуждение исходный текст
Ответы Re: "org.postgresql.util.PSQLException: This ResultSet is  (Oliver Jowett <oliver@opencloud.com>)
Список 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 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

Вложения

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Marc Herbert
Дата:
Сообщение: Re: Selecting on non ASCII varchars
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: "org.postgresql.util.PSQLException: This ResultSet is