首页 > 其他 > 详细

存储过程的实例(公司)

时间:2018-03-20 14:22:17      阅读:206      评论:0      收藏:0      [点我收藏+]

    Connection con=MIFUWEBDB.jdbc.getConn();                      //创建连接
    CallableStatement cstmt=con.prepareCall("{call woread_rj_one(?,?,?,?,?,?)}");         //调用,存储过程
    cstmt.setString(1,productid);                              
    cstmt.setString(2,wayid);                               //将第2个参数的值设置成wayid
    cstmt.setString(3,orderid);
    cstmt.registerOutParameter(4,java.sql.Types.VARCHAR);                //第4个占位符为输出,类型是varchar
    cstmt.registerOutParameter(5,java.sql.Types.VARCHAR);
    cstmt.registerOutParameter(6,java.sql.Types.VARCHAR);
    cstmt.execute();                                  //执行
    String status = cstmt.getString(4);                          //获取返回来的第4个参数,并赋值给status
    String reason = cstmt.getString(5);
    String mobile = cstmt.getString(6);
    if(cstmt!=null){
      cstmt.close();
      cstmt=null;
    }
    if(con!=null){
      con.close();
      con=null;
    }

存储过程的实例(公司)

原文:https://www.cnblogs.com/liuqu/p/8608799.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!