This is an Oracle specific example of returning ResultSets from stored procedures via iBatis as out parameters. It may not be the best solution, but it works in 2.1.0 Make a directory "test" and put all files below in there, compile, include the right jar files on the classpath and run against your favorite Oracle instance (I used schema scott in the example) The example is a small adaptation from a example I found somewhere on the WIKI. --------------- Logon in Oracle as user "scott" and create the following package/package body: CREATE OR REPLACE PACKAGE example AS TYPE t_ref_cur IS REF CURSOR; PROCEDURE GetEmpRS (p_deptno IN emp.deptno%TYPE, p_recordset1 OUT t_ref_cur, p_recordset2 OUT t_ref_cur); end; CREATE OR REPLACE PACKAGE BODY example AS PROCEDURE GetEmpRS (p_deptno IN emp.deptno%TYPE, p_recordset1 OUT t_ref_cur, p_recordset2 OUT t_ref_cur) AS BEGIN OPEN p_recordset1 FOR SELECT ename, empno, deptno FROM emp WHERE deptno = p_deptno ORDER BY ename; OPEN p_recordset2 FOR SELECT ename, empno, deptno FROM emp WHERE deptno > p_deptno ORDER BY ename; END GetEmpRS; end; -------------------------------------------------------------- -------------------------------------------------------------- Main.java --------- package test; import com.ibatis.sqlmap.client.SqlMapClientBuilder; import com.ibatis.sqlmap.client.SqlMapClient; import com.ibatis.common.resources.Resources; import java.io.Reader; import java.sql.ResultSet; import java.util.HashMap; import java.util.List; import java.util.Map; public class Main { public static void main(String arg[]) throws Exception { String resource; Reader reader; List list; SqlMapClient sqlMap; resource = "test/SqlMapConfig.xml"; reader = Resources.getResourceAsReader (resource); sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); Map map = new HashMap(); map.put("in1", new Integer(10)); sqlMap.queryForObject("GetEmpRs", map); System.out.println("Set 1 --------------"); ResultSet rs1 = (ResultSet)map.get("output1"); while ( rs1.next() ) { System.out.println(rs1.getString(1)); } rs1.close(); System.out.println("--------------------"); System.out.println("Set 2 --------------"); ResultSet rs2 = (ResultSet)map.get("output2"); while ( rs2.next() ) { System.out.println(rs2.getString(1)); } rs2.close(); System.out.println("--------------------"); } } -------------------------------------------------------------- -------------------------------------------------------------- RefTypeHandler.java ------------------- package test; import java.sql.Ref; import java.sql.ResultSet; import java.sql.SQLException; import com.ibatis.sqlmap.client.extensions.ParameterSetter; import com.ibatis.sqlmap.client.extensions.ResultGetter; import com.ibatis.sqlmap.client.extensions.TypeHandlerCallback; import com.ibatis.sqlmap.engine.type.ResultGetterImpl; public class RefTypeHandler implements TypeHandlerCallback { public void setParameter(ParameterSetter arg0, Object arg1) throws SQLException { if (arg1 != null) { arg0.setObject(arg1); } } public Object getResult(ResultGetter arg0) throws SQLException { ResultSet result = (ResultSet)arg0.getObject(); return result; } public Object valueOf(String arg0) { return null; } } -------------------------------------------------------------- -------------------------------------------------------------- SQLMap.xml ---------- { call scott.example.GetEmpRS(?, ?, ?) } -------------------------------------------------------------- -------------------------------------------------------------- SqlMapConfig.xml ---------------- -------------------------------------------------------------- --------------------------------------------------------------