六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 102|回复: 0

Ibatis 调用存储过程 返回值为空 求真相

[复制链接]

升级  52%

30

主题

30

主题

30

主题

秀才

Rank: 2

积分
128
 楼主| 发表于 2013-2-5 01:20:02 | 显示全部楼层 |阅读模式
1:
首先看存储过程语句(我是用Navicat 8)
CREATE PROCEDURE `test14`(out i_c int)   begin    declare i_c int;    set i_c=1+3;   end; 
2:再看配置文件中的设置
    <parameterMap id="loginUserParameters" class="java.util.HashMap">         <parameter property="i_c" jdbcType="int" javaType="java.lang.Integer" mode="OUT"/>    </parameterMap> 
  
<procedure id="getAllUserByProu4" parameterMap="loginUserParameters"  >         {call test14(?)}    </procedure> 
3:在看我文件中的调用(贴主要代码)
HashMap<String,Integer> map=new HashMap<String,Integer>();map.put("i_c", null);sqlMap.startTransaction();sqlMap.insert("getAllUserByProu4",map);System.out.println("进入系统");System.out.println(map.get(i_c));sqlMap.commitTransaction();    我试过将HashMap<String,Integer>换成HashMap<Integer,Integer>.效果都一样哦。就是取不到值。我已经疯狂的找了一天的代码了。。哎没辙了哈。坐等真相
           
 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表