JdbcTemplate batchUpdate
可以用来进行批量操作加入spring事务,目前发现一种能通过spring编程式事务(基于TransactionTemplate
的事务管理)可以实现。
1.不带返回类型
public void transfer(final List sqls) {
transactionTemplate.execute(new
TransactionCallbackWitho utResult(){
protected
void doInTransactionWithoutRe sult(TransactionStatus status)
{
try
{
//JdbcTemplate batchUpdate操作
JdbcTemplate.batchUpdate(List sqls);
}
catch (Exception e) {
System.out.println('----------RuntimeException-----'+e);
1.不带返回类型
