spring jdbctemplate

时间:2016-10-19 09:00:49

标签: java spring jdbc jdbctemplate

我想使用jdbctemplate实现上述目的。

我使用jdbc进行以下操作:

Connection conn = DBUtilities.getSQLConnection(); 
// get a connection
Statement stmt = conn.createStatement(); 
//create statement
stmt.addBatch(sql1);
//first sql statement to be added
stmt.addBatch(sql2);
//second sql to be added
stmt.executeBatch();

ResultSet rs = stmt.executeQuery(sql3); 
//third sql that uses previous sql 1 and 2

如何使用jdbctemplate添加多个SQL(批处理)?

0 个答案:

没有答案