ibatis 调用存储过程返回游标问题

存储过程:
create or replace procedure P_search(weight_value in integer, p_cursor out types.searchNature_CURSOR) as
begin
open p_cursor for
select globalId
from (select sum(WEIGHT) as w, globalId
from EMPI_TEMP
group by globalId
order by sum(WEIGHT) desc)
where w > weight_value;

end P_search;


sqlMap.xml:


javaType="java.lang.Integer" mode="IN" />
javaType="java.sql.ResultSet" mode="OUT"/>


{call p_search(?,?)}


java:

SqlMapClient client = IBatisConfig.getSqlMapper();
Map map = new HashMap();
map.put("weight_value", 30);
try {
@SuppressWarnings({ "unused", "unchecked" })
List list = client.queryForList("query_search",map);
System.out.println(list.size());
}
catch (SQLException e) {

}


使用 ibatis 2.1.6 版本执行有问题。搞了半天。发现时这个版本对存储过程支持有问题。
换成 2.3.4 问题解决。

你可能感兴趣的:(ibatis 调用存储过程返回游标问题)