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 康文 閱讀(210) 評論(0)  編輯  收藏 所屬分類: java

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

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 华池县| 合肥市| 清远市| 丘北县| 中江县| 高唐县| 达尔| 托克逊县| 张北县| 东山县| 高邮市| 三河市| 民丰县| 宜宾县| 胶南市| 安义县| 轮台县| 汝阳县| 馆陶县| 和田市| 威宁| 新绛县| 铜鼓县| 呼和浩特市| 徐汇区| 台州市| 南岸区| 丽江市| 宜州市| 清河县| 宝丰县| 阳城县| 准格尔旗| 郓城县| 江山市| 洛浦县| 祁阳县| 呼玛县| 河间市| 罗定市| 松原市|