Re: JDBC2 driver failure

From: "Wadhwa, Amit" <Amit_Wadhwa(at)Dell(dot)com>
To: "Haig Ehramdjian" <haige(at)cae(dot)com>, "Mailing List: PGSQL (E-mail)" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC2 driver failure
Date: 2003-03-27 23:14:52
Message-ID: D84C5C69F2723B43BD7AAFA63D4012BA64EF3B@blrx2kmbgl101.blr.amer.dell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

use a different statement object for the nested resultset.
ie.
ResultSet rs = null;
ResultSet rs2 = null;
Statement stmt = con.createStatement();
Statement stmt2 = con.createStatement();

rs = stmt.executeQuery("myQuery");

while (rs.next()) {
//some processing
String query = "blahblah";
rs2 = stmt2.executeQuery(query);
}
-----Original Message-----
From: Haig Ehramdjian [mailto:haige(at)cae(dot)com]
Sent: Wednesday, March 26, 2003 1:58 AM
To: Mailing List: PGSQL (E-mail)
Subject: [JDBC] JDBC2 driver failure

Hello,

I have some code that does the following:

ResultSet rs = stmt.executeQuery("myQuery");

while (rs.next()) {
//some processing
String query = "blahblah";
ResultSet rs2 = stmt.executeQuery(query);
}

All the processing up to rs2 works fine, but the instant I try to get the
result set,
I get the following errors in my catalina.out log file on Tomcat4:

java.lang.NullPointerException
at org.postgresql.jdbc2.ResultSet.next(ResultSet.java:113)
at
org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java)

Any ideas? This is part of an in-house app I'm building and seems to be the
last stumbling block.

Thanks a lot,
Haig Ehramdjian

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Laban 2003-03-28 16:01:31 Re: JDBC with SSL
Previous Message Barry Lind 2003-03-27 22:58:03 Re: JDBC with SSL