中易网

mybatis怎么接收调用存储过程返回的参数

答案:2  悬赏:0  
解决时间 2021-04-28 00:30
  • 提问者网友:护她一生,唯爱
  • 2021-04-27 16:39
mybatis怎么接收调用存储过程返回的参数
最佳答案
  • 二级知识专家网友:而你却相形见绌
  • 2021-04-27 17:16
帮你看了半天,没有找到好的解决办法,变相方法是可以在plsql中返回一个ref cursor,java中直接用resultset就能接收了。

希望其他人能回答你的问题吧。。
全部回答
  • 1楼网友:野性且迷人
  • 2021-04-27 18:51
首先定义一个mysql存储过程: drop procedure if exists test ; create procedure test (in p1 varchar(26), out presult varchar(512)) begin set presult := null; set presult :=concat ( 'test',p1); select * from tb2 where commet like concat('%',p1, '%'); -- this 返回一个结果集 end; tb2的表结构和数据如下: drop table if exists `tb2`; create table `tb2` ( `t_id` int(10) not null auto_increment comment '主键', `name` varchar(255) default null comment '字段名', `type` int(1) default null comment '类型,0-正常,1-异常,2-传输,3-退单', `commet` varchar(255) default null comment '备注',
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息