Re: exception while upgrading driver

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: exception while upgrading driver
Дата
Msg-id Pine.BSO.4.56.0506071413110.5751@leary.csoft.net
обсуждение исходный текст
Ответ на exception while upgrading driver  (Sathyajith G <sathyajith@inbox.com>)
Ответы Re: exception while upgrading driver  (Sathyajith G <sathyajith@inbox.com>)
Список pgsql-jdbc

On Tue, 7 Jun 2005, Sathyajith G wrote:

>    i have the following code running without any errors with postgres 7.4.2.
> driver.
>
> String qry="select ...;
>
> try{
>   ResultSet rs=Data.getResultSet(qry);
>   while(rs.next())
>
> I changed the driver to postgres 8.0.1.  Strangely now, the above code gives
> the exception "The resultset is closed". Please help.
>

I suspect your Data.getResultSet() method looks something like this:


Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
stmt.close();
return rs;

This is not a legal thing to do, closing the Statement also closes the
ResultSet that was created by it.  The 7.4 driver did not correctly check
this, but the 8.0 version does.  You most postpone the Statement close
until you are done with the ResultSet.

Kris Jurka

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

Предыдущее
От:
Дата:
Сообщение: 8.x driver with EJB CMP
Следующее
От: Sathyajith G
Дата:
Сообщение: Re: exception while upgrading driver