public void update(String sql,Object ... args){
Connection connection = null;
try {
connection = JdbcUtils.getConnection();
queryRunner.update(connection, sql, args);
System.out.println("here...");
} catch (Exception e) {
e.printStackTrace();
}finally {
JdbcUtils.releaseConnection(connection);
}
}
public class Test extends DAO<Customer>{
@org.junit.Test
public void test(){
String sql = "delete customer where \"id\" = ?";
System.out.println("start");
update(sql, 2);
System.out.println("success");
}
}
如上,求各位解答,谢谢!