zoukankan      html  css  js  c++  java
  • 存储过程的实例(公司)

        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的OUT参数,注册,给定的JDBC类型
        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;
        }

  • 相关阅读:
    搞懂分布式技术7:负载均衡概念与主流方案
    搞懂分布式技术6:Zookeeper典型应用场景及实践
    Django学习系列之django分页
    Python学习系列之format用法
    Python进阶系列之怎么写出pythonic的代码
    Python学习系列之内置函数
    域名添加HTTPS
    zabbix学习系列之QQ消息报警
    zabbix学习系列之配置邮件告警
    zabbix学习系列之触发器
  • 原文地址:https://www.cnblogs.com/liuqu/p/8608799.html
Copyright © 2011-2022 走看看