Thomas Hill <[email protected]> writes:
> Hi,
> can someone please share an example how the Client side application code to
> call
> procedure looks like when I want my stored procedure to return TWO resultsets?
> The derby Wiki (extract see below) says 'WORK IN PROGRESS' in the section
> where
> documentation on this had been started.
>
> CallableStatement cs = conn.prepareCall("{ call DRS2(?, ?)}");
> cs.setInt(1, p1);
> cs.setInt(2, p2);
> cs.execute();
> WORK IN PROGESS
Hi Thomas,
I've updated the example on the wiki so that the example now looks like
this:
CallableStatement cs = conn.prepareCall("{ call DRS2(?, ?)}");
cs.setInt(1, p1);
cs.setInt(2, p2);
boolean hasResults = cs.execute();
while (hasResults) {
ResultSet rs = cs.getResultSet();
while (rs.next()) {
// ....
}
rs.close();
hasResults = cs.getMoreResults();
}
--
Knut Anders