我想执行多个单独的SQL语句,就像在JDBC菜谱中:
Statement stmt = con.createStatement();
stmt.addBatch(
"update registration set balance=balance-5.00
where theuser="+theuser);
stmt.addBatch(
"insert into auctionitems(
description, startprice)
values("+description+","+startprice+")");
我必须直接使用Statement对象吗?我正在寻找一些提供相同功能的Spring JDBCTemplate服务。
额外加分: 更好的是一个服务,它可以接受一个包含多个用;
分隔的SQL语句的文本,并执行它们所有。
谢谢,Ido