posted 15 years ago
My stored procedure on AS400 returns a result set to the caller. The 'execute' is successful. (returns true)
But, when I read the result set, there are no records. Please see sample code below:
CallableStatement sqlCall = connection.prepareCall("CALL PROC1(?,?,?)");
// Run an SQL SELECT statement
sqlCall.setInt(1, 1) ;
sqlCall.setInt(2, 5) ;
sqlCall.registerOutParameter(3, java.sql.Types.INTEGER);
System.out.println ("Calling the as400 procedure...");
boolean b = sqlCall.execute();
if(b){
ResultSet rs = sqlCall.getResultSet();
System.out.println ("Retrieving the out parms...");
int total = sqlCall.getInt(3);
while(rs.next())
{
// do something here...
}
} //end if
The value of 'b' is true. getResultSets() also is not null. (Returns a id=CSRS0001 while doing println(rs) )
I am breaking my head over why I am not able to read any records? Any help is appreacited.