Hi all!
This simple procedure works fine when I call it from Command Center - DB2 7.2, and returns 2 resultsets.

But When I try to get ResultSets ffrom Java it gets only first ResultSet - any ideas!?

P.S. I`m using WebSphere Application Developer 4.03

Java code:
NOTE! getMoreResults() ALWAYS RETURNS false! - but if I call proc from
Control Center proc returns 2 result sets!!!! !?!
======================
String procCall = "{ call sb4a.letitbe() }";

CallableStatement cstmt = connection.prepareCall(procCall);
boolean retval = cstmt.execute();
if (retval == false) {
// The statement returned an update count, so handle it.
// ...
} else { // ResultSet
ResultSet rs1 = cstmt.getResultSet();
// ... process rs1
rs1.close()

retval = cstmt.getMoreResults();
if (retval == true) {
ResultSet rs2 = cstmt.getResultSet();

// .... process rs2
rs2.close();
// ...
}
}



Here i the code
=====================
/**
* JDBC Stored Procedure SB4A.letitbe
*/
import java.sql.*; // JDBC classes

public class Letitbe
{
public static void letitbe ( ResultSet[] rs ) throws SQLException, Exception
{
// Get connection to the database
Connection con = DriverManager.getConnection("jdbc:default:connecti on");
PreparedStatement stmt1 = null;
PreparedStatement stmt2 = null;
String sql;

rs = new ResultSet[2];
sql = "SELECT count(*) as user_count FROM SB4a.user";
stmt1 = con.prepareStatement( sql );
rs[0] = stmt1.executeQuery();

stmt2 = con.prepareStatement( sql );
rs[1] = stmt2.executeQuery();

if (con != null) con.close();
}
}