Navicat创建存储过程
点击保存时出现如下错误:
参考了如下博客,说是要为字符串类型的参数设置长度。
https://blog.csdn.net/weixin_38318037/article/details/78685900
在Navicat中测试存储过程:
Mybatis调用存储过程
<select id="createUserTable" statementType="CALLABLE" parameterType="map">
{
call create_user(#{id,mode=IN,jdbcType=INTEGER},#{result,mode=OUT,jdbcType=INTEGER})
}
</select>
statementType必须设置为CALLABLE
Integer createUserTable(Map<String,Object> params);
测试:
Map<String,Object> params=new HashMap<>();
params.put("id", 5);
userDao.createUserTable(params);
System.out.println(params.get("result"));
发现成功的返回了result结果。
参考:https://blog.csdn.net/qq_32786873/article/details/62881811
https://blog.csdn.net/weixin_38318037/article/details/78685900
https://www.cnblogs.com/kongxc/p/8667046.html
https://blog.csdn.net/sinat_36265222/article/details/78343129
https://www.cnblogs.com/xjxz/p/7091070.html
https://blog.csdn.net/qq_20975027/article/details/78343972