zoukankan      html  css  js  c++  java
  • java调用储存过程的方法

    java调用储存过程的方法

      public static Integer getStock(String strdate, Long orgId, Long productId){

      if(strdate==null||orgId==null||productId==null)

      throw new IllegalArgumentException();

      Integer stock = null;

      //DataAccess da = DataAccessFactory.create(BPMConstant.ERP_DATABASE);

      Connection conn=null;

      CallableStatement fun = null;

      try {www.cdtarena.com

      String callSQL = "{?=call getstock(?,?,?)} ";

      //Connection conn = da.getConnection();

      conn=DBUtil.getConnection(BPMConstant.ERP_DATABASE);

      fun = conn.prepareCall(callSQL);

      fun.registerOutParameter(1, oracle.jdbc.OracleTypes.NUMBER);

      fun.setString(2, strdate);

      fun.setLong(3, orgId);

      fun.setLong(4, productId);

      fun.execute();

      stock = fun.getInt(1);

      }catch(Exception e){

      e.printStackTrace();

      }finally{

      DBUtil.closeCallableStatement(fun);

      DBUtil.closeConnection(conn);

      }

      return stock;

  • 相关阅读:
    作为另一个函数的值(读书摘)
    算法-二分查找与二叉排序树
    算法-图
    算法-二叉树
    算法-分治
    算法-回溯
    算法-动态规划
    算法-贪心
    算法-堆
    算法-栈,队列
  • 原文地址:https://www.cnblogs.com/cdtarena/p/2959467.html
Copyright © 2011-2022 走看看