This is an Oracle specific example of returning ResultSets/nested Resultsets from iBatis. 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. 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(); sqlMap.queryForObject("getdeptemp", map); ResultSet rs1 = (ResultSet)map.get("output"); while ( rs1.next() ) { System.out.println(rs1.getString(1)); ResultSet rs2 = (ResultSet)rs1.getObject(2); while ( rs2.next() ) { System.out.println(" " + rs2.getString(1)); } } 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 ---------- begin open ? for select dname, cursor(select ename from scott.emp e where e.deptno = d.deptno) from scott.dept d; end; -------------------------------------------------------------- -------------------------------------------------------------- SqlMapConfig.xml ---------------- -------------------------------------------------------------- --------------------------------------------------------------