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) 評(píng)論(0)  編輯  收藏 所屬分類: java

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

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 马关县| 图们市| 卢湾区| 沅江市| 六安市| 雷州市| 杭锦后旗| 鹤山市| 上蔡县| 天全县| 临夏县| 龙井市| 桦南县| 桦川县| 日喀则市| 大荔县| 萨嘎县| 雷州市| 孟津县| 宁都县| 满洲里市| 平乡县| 湄潭县| 罗定市| 莆田市| 洛阳市| 图片| 栾川县| 温宿县| 东方市| 特克斯县| 云南省| 南和县| 芒康县| 鹿泉市| 和龙市| 姜堰市| 江西省| 固镇县| 丹阳市| 大庆市|