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();
?????}
??});
/**
- * Copyright: Copyright (c) 2005-2005
- * Company: JavaResearch(http://www.javaresearch.org)
- */
- package org.javaresearch.jerch;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- /**
- * PreparedStatement回調(diào)接口定義。
- * 最后更新日期:2005年3月28日
- * @author cherami
- */
- publicinterfacePreparedStatementCallback {
- ? /**
- ?? * 定義PreparedStatement中的執(zhí)行內(nèi)容。
- ?? * 執(zhí)行前PreparedStatement的參數(shù)等內(nèi)容都已經(jīng)設(shè)置好了。
- ?? * @param stmt PreparedStatement
- ?? * @return 執(zhí)行的結(jié)果
- ?? * @throws SQLException
- ?? */
- ? publicObject doInPreparedStatement(PreparedStatement stmt) throwsSQLException;
- }
大盤(pán)預(yù)測(cè)
國(guó)富論
posted on 2007-09-10 11:10
華夢(mèng)行 閱讀(4320)
評(píng)論(0) 編輯 收藏 所屬分類:
Spring