-
/**
-
* Copyright: Copyright (c) 2005-2005
-
* Company: JavaResearch(http://www.javaresearch.org)
-
*/
-
package
org.javaresearch.jerch;
-
-
import
java.sql.PreparedStatement;
-
import
java.sql.SQLException;
-
-
/**
-
* 設置PreparedStatement的參數的接口定義。
-
* 最后更新日期:2005年3月28日
-
* @author cherami
-
*/
-
public
interface
PreparedStatementSetter
{
- ? /**
-
?? * 設置PreparedStatement所需的全部參數。
-
?? * @param ps PreparedStatement
-
?? * @throws SQLException
-
?? */
- ? publicvoid setValues(PreparedStatement ps)? throwsSQLException;
- }
-
- 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
華夢行 閱讀(4022)
評論(0) 編輯 收藏 所屬分類:
Spring