Re: first() causes NullPointerException

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: first() causes NullPointerException
Дата
Msg-id Pine.BSO.4.56.0412230526470.22886@leary.csoft.net
обсуждение исходный текст
Ответ на first() causes NullPointerException  ("Nico" <nicohmail-postgresql@yahoo.com>)
Список pgsql-jdbc

On Thu, 23 Dec 2004, Nico wrote:

> I have a servlet that extracts data from a postgresql database and makes a
> nice menu of it. The connection works fine, I can execute my sql-statement
> without any problems, but when I try the first() method of ResultSet it
> fails: it throws a NullPointerException at line 216.
>
>             resultsetL1=getQuery("SELECT * FROM \"qryMenuL1\" ORDER BY "+
>                 "\"MenuL1Order\"");
>             resultsetL1C=getQuery("SELECT COUNT(\"MenuL1ID\") FROM
> \"qryMenuL1\"");

According to the JDBC spec you are only allowed to have one ResultSet open
per Statement.  When you create the second ResultSet the first is
automatically closed.  This causes the NPE or in the CVS version of the
driver an error message indicating that the result is already closed.

Kris Jurka

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

Предыдущее
От: "Nico"
Дата:
Сообщение: first() causes NullPointerException
Следующее
От: "Nico"
Дата:
Сообщение: Re: first() causes NullPointerException