ibatis 调用存储过程返回游标问题
2011年03月01日
存储过程:
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:
{call p_search(?,?)}
java:
SqlMapClient client = IBatisConfig.getSqlMapper();
Map map = new HashMap();
map.put("weight_value", 30);
try {
List list = client.queryForList("query_search",map);
System.out.println(list.size());
}
catch (SQLException e) {
}
使用 ibatis 2.1.6 版本执行有问题。搞了半天。发现时这个版本对存储过程支持有问题。
换成 2.3.4 问题解决。
2011年03月01日
存储过程:
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:
{call p_search(?,?)}
java:
SqlMapClient client = IBatisConfig.getSqlMapper();
Map map = new HashMap();
map.put("weight_value", 30);
try {
List list = client.queryForList("query_search",map);
System.out.println(list.size());
}
catch (SQLException e) {
}
使用 ibatis 2.1.6 版本执行有问题。搞了半天。发现时这个版本对存储过程支持有问题。
换成 2.3.4 问题解决。