隨筆-295  評論-26  文章-1  trackbacks-0
          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. public interface PreparedStatementSetter {
          14. ? /**
          15. ?? * 設置PreparedStatement所需的全部參數。
          16. ?? * @param ps PreparedStatement
          17. ?? * @throws SQLException
          18. ?? */
          19. ? publicvoid setValues(PreparedStatement ps)? throwsSQLException;
          20. }
          21. jt.query("select address from owners where first_name = ? and last_name = ?",
            ????new PreparedStatementSetter(){
            ?????public void setValues(PreparedStatement ps) throws SQLException {
            ??????ps.setString(1, "Jeff");
            ??????ps.setString(2, "Black");
            ?????}
            ????},
            ????new RowMapper(){
            ?????public Object mapRow(ResultSet rs, int rowNum) throws SQLException {??????
            ??????return rs.getString("address");
            ?????}
            ????}));


          大盤預測 國富論
          posted on 2007-09-10 10:54 華夢行 閱讀(4030) 評論(0)  編輯  收藏 所屬分類: Spring
          主站蜘蛛池模板: 金坛市| 紫金县| 龙口市| 芮城县| 军事| 南丹县| 黑河市| 汝南县| 娄底市| 会宁县| 东明县| 华蓥市| 澄城县| 舟曲县| 洛扎县| 高碑店市| 环江| 普格县| 自治县| 南昌市| 永和县| 和静县| 常德市| 鸡东县| 合阳县| 云浮市| 尚志市| 海口市| 定兴县| 平顶山市| 西丰县| 清新县| 石楼县| 老河口市| 扎赉特旗| 武城县| 黎平县| 科技| 宣武区| 定襄县| 曲周县|