in order to read all the records returned by the execution of a query do
this
while(rs.next()){
do whatever
}
rs.next() advances the pointer to the next record in the result set and that
way you can go till the end of the result set.
You could read the api under java.sql.* to understand this function better.
Irfan
-----Original Message-----
From: Jimmi Dyson [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 12, 2000 4:13 AM
To: [EMAIL PROTECTED]
Subject: Multiple results sets
Hi.
After executing a stor proc with multiple ResultSets selected, how do you
get each of the ResultSets back? The code below gets back the first
resultset selected by P_dindin, but not the second. What am I doing wrong?
ps.getMoreResults() is true when it is called, but rs1 never gets any
results back.
My code that I thought was correct looks like this:
try {
Class.forName(...NameOfDriver...).newInstance();
Connection con = DriverManager.getConnection(...URL...);
CallableStatement cs = con.prepareCall("{call P_dindin}");
ResultSet rs;
if (cs.execute()) {
rs = cs.getResultSet();
.....do stuff.......
if (ps.getMoreResults()) {
rs = ps.getResultSet();
....do more stuff....
}
}
} catch (Exception ex) {....}
Thank you in advance.
Jimmi Dyson
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets