X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CDE8C3AC5B4 for ; Thu, 23 Dec 2004 11:06:55 +0000 (GMT) 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 63536-10 for ; Thu, 23 Dec 2004 11:06:43 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.250.190.2]) by svr1.postgresql.org (Postfix) with ESMTP id BE88F3A683A for ; Thu, 23 Dec 2004 11:06:43 +0000 (GMT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id D271D31982; Thu, 23 Dec 2004 12:06:42 +0100 (MET) From: "Nico" X-Newsgroups: pgsql.interfaces.jdbc Subject: Re: first() causes NullPointerException Date: Thu, 23 Dec 2004 12:06:36 +0100 Organization: Hub.Org Networking Services Lines: 32 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.721 tagged_above=0 required=5 tests=AWL, FORGED_YAHOO_RCVD, PRIORITY_NO_NAME X-Spam-Level: ** X-Archive-Number: 200412/178 X-Sequence-Number: 11844 Thanks. I will try it right away. Nico. "Kris Jurka" schreef in bericht news:Pine.BSO.4.56.0412230526470.22886@leary.csoft.net... > > > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >