java.lang.NullPointerException on imbricated queries - Mailing list pgsql-jdbc

From Olivier BULLAT
Subject java.lang.NullPointerException on imbricated queries
Date
Msg-id 5.0.2.1.2.20030630103241.0186ed60@mail.ifma.fr
Whole thread Raw
Responses Re: java.lang.NullPointerException on imbricated queries
Re: java.lang.NullPointerException on imbricated queries
List pgsql-jdbc
<font face="Courier New, Courier">Hello,<br />  <br /> We </font>have a web application in Apache, Posgresql 7.2,
servletjava (JDK 1.2), Jserv and jdbc7.2dev-1.2.jar. <br /> A lot of programs runs normally with JDBC access to
postgresql.But when we use two imbricated queries like this example, a message <font face="Courier New,
Courier">JAVALANGEXEPTIONjava.lang.NullPointerException occurs</font>:<br /><br /><font face="Courier New,
Courier">1       Query1= </font><font color="#00CB00" face="Courier New, Courier">"SELECT * FROM example1;"</font><font
face="CourierNew, Courier">;<br /> 2       rs1 = stmt.executeQuery(Query1);<br /> 3       </font><font color="#941EDF"
face="CourierNew, Courier">while</font><font face="Courier New, Courier"> (rs1.next()) {<br /> 4               Query2 =
</font><fontcolor="#00CB00" face="Courier New, Courier">"SELECT * FROM example2;<br /></font><font face="Courier New,
Courier">5               rs2= stmt.executeQuery(Query2);<br /> 6               </font><font color="#941EDF"
face="CourierNew, Courier">while</font><font face="Courier New, Courier"> (rs2.next()) {<br />
7                       //Something .../...<br /> 8               }<br /> 9       }                               <br
/><br/> Programme DetailsRapports.java: JAVALANGEXEPTION java.lang.NullPointerException: <br />
java.lang.NullPointerException:<br />         at org.postgresql.jdbc2.ResultSet.next(ResultSet.java:113)<br />
        atDetailsRapports.AfficheEntrees(DetailsRapports.java:68)<br />         at
DetailsRapports.service(DetailsRapports.java:43)<br/>         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:588)<br/>         at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)<br/>         at
org.apache.jserv.JServConnection.run(JServConnection.java:188)<br/>         at java.lang.Thread.run(Thread.java:479)<br
/><br/> This message occurs on line 3 "</font><font color="#941EDF" face="Courier New, Courier">while</font><font
face="CourierNew, Courier"> (rs1.next()) {" after a first good Query1 and a first good Query2.<br /><br /> Any help
wouldbe appreciated.<br /><br /><br /></font><p>
--------------------------------------------------------------------------<br/> Olivier BULLAT<br /> Responsable du
Centrede Ressources Informatiques<br /> Institut Francais de Mecanique Avancee - IFMA<br /> Campus de CLERMONT-FERRAND
/Les Cezeaux<br /> BP 265<br /> 63175 AUBIERE Cedex<br /> Tel:   04.73.28.80.35<br /> Fax:  04.73.28.81.00<br /> mail:
<fontcolor="#0000FF"><u>Olivier.Bullat@ifma.fr<br /><a eudora="autourl"
href="http://www.ifma.fr/">http://www.ifma.fr</a><br
/></u></font>-------------------------------------------------------------------------- 

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: [PATCHES] IPv6 patch doesn't work fine
Next
From: "Kallol Nandi"
Date:
Subject: Re: java.lang.NullPointerException on imbricated queries