• 关于JAVA调用oracle存储过程


     Session s = this.getSession();
      CallableStatement cstm = null;
      String flag = null;
      try {
       cstm = ((SessionImplementor) s)
         .getBatcher()
         .prepareBatchCallableStatement(
           "call proc_applyfeelist(?,?,?,?)");
       cstm.setString(1, applyfee.getSubcompany());
       cstm.setDate(2, DateUtils
         .toHibernateDate(applyfee.getStartdate()));
       cstm.setDate(3, DateUtils
         .toHibernateDate(applyfee.getEnddate()));
       cstm.registerOutParameter(4, Types.CHAR);//返回值
       cstm.execute();
       flag = cstm.getString(4);//获取返回值
      } catch (SQLException ex2) {
       System.out.println(ex2.getMessage());
       FormatUtils.throwSQLException(ex2.getMessage());
      } finally { // 关闭cstm
       try {
        if (cstm != null)
         cstm.close();
       } catch (SQLException e) {
        throw new BusinessException(e);
       }
      }

  • 相关阅读:
    服务器
    python的并发编程学习
    python的网络编程学习
    python的基础学习 模块
    pymysql基础操作
    查询简单练习
    数据准备
    数据库的三大设计范式
    数据库基础-建表约束
    mysql基础-基本语法
  • 原文地址:https://www.cnblogs.com/xiyuanbaiyun/p/2192023.html
Copyright © 2020-2023  润新知