<html>
<font face="Courier New, Courier">Hello,<br>
<br>
We </font>have a web application in Apache, Posgresql 7.2, servlet java
(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">JAVALANGEXEPTION
java.lang.NullPointerException occurs</font>:<br>
<br>
<font face="Courier New, Courier">1<x-tab> </x-tab>Query1
= </font><font face="Courier New, Courier" color="#00CB00">"SELECT *
FROM example1;"</font><font face="Courier New, Courier">;<br>
2<x-tab> </x-tab>rs1 =
stmt.executeQuery(Query1);<br>
3<x-tab> </x-tab></font><font face="Courier New, Courier" color="#941EDF">while</font><font face="Courier New, Courier">
(rs1.next()) {<br>
4<x-tab> </x-tab><x-tab> </x-tab>Query2
= </font><font face="Courier New, Courier" color="#00CB00">"SELECT *
FROM example2;<br>
</font><font face="Courier New, Courier">5<x-tab> </x-tab><x-tab> </x-tab>rs2
= stmt.executeQuery(Query2);<br>
6<x-tab> </x-tab><x-tab> </x-tab></font><font face="Courier New, Courier" color="#941EDF">while</font><font face="Courier New, Courier">
(rs2.next()) {<br>
7<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab>//
Something .../...<br>
8<x-tab> </x-tab><x-tab> </x-tab>}<br>
9<x-tab> </x-tab>}<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab>
<br>
<br>
Programme DetailsRapports.java: JAVALANGEXEPTION
java.lang.NullPointerException: <br>
java.lang.NullPointerException: <br>
<x-tab> </x-tab>at
org.postgresql.jdbc2.ResultSet.next(ResultSet.java:113)<br>
<x-tab> </x-tab>at
DetailsRapports.AfficheEntrees(DetailsRapports.java:68)<br>
<x-tab> </x-tab>at
DetailsRapports.service(DetailsRapports.java:43)<br>
<x-tab> </x-tab>at
javax.servlet.http.HttpServlet.service(HttpServlet.java:588)<br>
<x-tab> </x-tab>at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)<br>
<x-tab> </x-tab>at
org.apache.jserv.JServConnection.run(JServConnection.java:188)<br>
<x-tab> </x-tab>at
java.lang.Thread.run(Thread.java:479)<br>
<br>
This message occurs on line 3
"</font><font face="Courier New, Courier" color="#941EDF">while</font><font face="Courier New, Courier">
(rs1.next()) {" after a first good Query1 and a first good
Query2.<br>
<br>
Any help would be appreciated.<br>
<br>
<br>
</font><x-sigsep><p></x-sigsep>
--------------------------------------------------------------------------<br>
Olivier BULLAT<br>
Responsable du Centre de 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: <font color="#0000FF"><u>Olivier(dot)Bullat(at)ifma(dot)fr<br>
<a href="http://www.ifma.fr/" eudora="autourl">http://www.ifma.fr</a><br>
</u></font>--------------------------------------------------------------------------
</html>