jdbc-batch processing

          the addBatch() method is basically nothing more than a tool fro assigning a bunch of sql statements to a jdbc statement object for execution together

          PreparedStatement stmt=conn.prepareStatement(
          ????? "update account set balance=? where acct_id=?");
          int[] rows;
          for(int i=0;i<accts.length;i++){
          ??? stmt.setInt(1,i);
          ??? stmt.setLong(2,i);
          ??? stmt.addBatch();
          ? }
          rows=stemt.executeBatch();

          posted on 2006-10-11 14:40 康文 閱讀(213) 評論(0)  編輯  收藏 所屬分類: java

          <2006年10月>
          24252627282930
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 蕲春县| 赤峰市| 新宾| 湛江市| 中方县| 乌拉特中旗| 沅江市| 寿宁县| 宾川县| 廊坊市| 尤溪县| 易门县| 巴里| 德庆县| 江达县| 麻栗坡县| 新和县| 长白| 莎车县| 息烽县| 修文县| 阳新县| 奉化市| 方山县| 波密县| 宜阳县| 正阳县| 专栏| 青浦区| 弥渡县| 沅陵县| 汾阳市| 东莞市| 崇礼县| 汉寿县| 共和县| 衡水市| 霍邱县| 济宁市| 利川市| 平果县|