隨筆-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 華夢行 閱讀(4322) 評論(0)  編輯  收藏 所屬分類: Spring
          主站蜘蛛池模板: 容城县| 荆州市| 马尔康县| 西充县| 容城县| 宜宾县| 垣曲县| 五华县| 城市| 龙川县| 新和县| 台州市| 舒城县| 新丰县| 龙陵县| 长阳| 洛阳市| 敦煌市| 江油市| 华蓥市| 自贡市| 文昌市| 天门市| 亳州市| 柘荣县| 朝阳市| 广平县| 安宁市| 文登市| 宜兴市| 徐水县| 成都市| 锡林浩特市| 和林格尔县| 贵德县| 安陆市| 胶州市| 尼木县| 通道| 曲阳县| 黑山县|