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)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 澄江县| 桂平市| 新余市| 子洲县| 田东县| 天津市| 湘阴县| 定南县| 双流县| 前郭尔| 博客| 新疆| 志丹县| 营口市| 北宁市| 卓资县| 凤城市| 平山县| 吉木萨尔县| 辽宁省| 中宁县| 贵定县| 宿州市| 车致| 泾川县| 荥阳市| 沧州市| 淮阳县| 四平市| 罗田县| 盐池县| 泰来县| 大邑县| 玉田县| 濮阳市| 庆云县| 九龙县| 丹巴县| 商洛市| 灵台县| 河北区|