隨筆-295  評論-26  文章-1  trackbacks-0
          jt.execute("update owners set address = 'GuangZhou' where telephone = ?",
          ????new PreparedStatementCallback(){
          ?????public Object doInPreparedStatement(PreparedStatement ps) throws SQLException, DataAccessException {
          ??????ps.setString(1, "16068008");
          ??????ps.addBatch();
          ??????ps.setString(1, "6085555487");
          ??????ps.addBatch();
          ??????return ps.executeBatch();
          ?????}
          ??});
          1. /**


          2. * Copyright: Copyright (c) 2005-2005
          3. * Company: JavaResearch(http://www.javaresearch.org)
          4. */
          5. package org.javaresearch.jerch;

          6. import java.sql.PreparedStatement;
          7. import java.sql.SQLException;

          8. /**
          9. * PreparedStatement回調接口定義。
          10. * 最后更新日期:2005年3月28日
          11. * @author cherami
          12. */
          13. publicinterfacePreparedStatementCallback {
          14. ? /**
          15. ?? * 定義PreparedStatement中的執行內容。
          16. ?? * 執行前PreparedStatement的參數等內容都已經設置好了。
          17. ?? * @param stmt PreparedStatement
          18. ?? * @return 執行的結果
          19. ?? * @throws SQLException
          20. ?? */
          21. ? publicObject doInPreparedStatement(PreparedStatement stmt) throwsSQLException;
          22. }


          大盤預測 國富論
          posted on 2007-09-10 11:10 華夢行 閱讀(4327) 評論(0)  編輯  收藏 所屬分類: Spring
          主站蜘蛛池模板: 随州市| 阿巴嘎旗| 香格里拉县| 涞源县| 渭南市| 宁南县| 岐山县| 庐江县| 瓮安县| 高陵县| 乌鲁木齐市| 信丰县| 齐齐哈尔市| 晋江市| 建昌县| 三江| 临泽县| 六盘水市| 潮州市| 虹口区| 凤冈县| 安丘市| 前郭尔| 陆川县| 正镶白旗| 马关县| 当涂县| 卓尼县| 周宁县| 仁怀市| 油尖旺区| 横峰县| 新宾| 东乌珠穆沁旗| 巧家县| 六枝特区| 孙吴县| 正镶白旗| 吴川市| 十堰市| 太康县|