隨筆-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. * 設(shè)置PreparedStatement的參數(shù)的接口定義。
          10. * 最后更新日期:2005年3月28日
          11. * @author cherami
          12. */
          13. public interface PreparedStatementSetter {
          14. ? /**
          15. ?? * 設(shè)置PreparedStatement所需的全部參數(shù)。
          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");
            ?????}
            ????}));


          大盤預(yù)測 國富論
          posted on 2007-09-10 10:54 華夢行 閱讀(4030) 評論(0)  編輯  收藏 所屬分類: Spring
          主站蜘蛛池模板: 精河县| 赫章县| 江达县| 时尚| 澳门| 舟曲县| 凤庆县| 上饶市| 宁南县| 虎林市| 孝昌县| 呼图壁县| 乌兰浩特市| 三亚市| 大荔县| 读书| 浦东新区| 新郑市| 景德镇市| 繁峙县| 阜平县| 博野县| 剑阁县| 高要市| 监利县| 绥滨县| 陵川县| 岐山县| 肥西县| 桑日县| 莒南县| 兴和县| 德江县| 曲麻莱县| 工布江达县| 策勒县| 泰州市| 全椒县| 台山市| 华宁县| 泾川县|