Hi, My RPG code creates two results sets but my Java program recognizes only one of them. Has anyone been successful in getting two result sets from a RPG into a Java? RPG code as follows: d const_1 s 1 0 inz(1) d ListOut ds Occurs(1) d #Occur s 1 0 inz(1) D ResultSet ds Occurs(6) D dmdPofFlag 1S 0 inz(0) C/Exec Sql C+ Set Result Sets Array : ListOut for :const_1 rows C/End-Exec C/Exec Sql C+ Set Result Sets Array : ResultSet for :#Occur rows C/End-Exec c Return Create the Stored Procedure around the RPG program Create Procedure mylib/PPP591SP (IN in_direction CHAR(8), IN in_priority DECIMAL(1,0), IN in_createTime CHAR(16)) result sets 2 EXTERNAL NAME mylib/ppp591R LANGUAGE RPGLE GENERAL Java Code: callableStmt = conn.prepareCall("{CALL mylib.PPP591SP(?, ?, ?)}"); callableStmt.setString( 1, "next"); callableStmt.setInt( 2, 0); callableStmt.setString( 3, "2000022214010000"); callableStmt.execute(); ResultSet rs = callableStmt.getResultSet(); // get first result set showData( rs ); rs.close(); if ( callableStmt.getMoreResults() ) { // THIS IS ALWAYS FALSE !!! ResultSet rs2 = callableStmt.getResultSet(); // get second result set showData( rs2 ); rs2.close(); } else { System.out.println( "SECOND RESULT SET NOT FOUND" ); // I GET THIS !! } }