代码如下:
QueryRunner queryRunner = new QueryRunner();
String sql = "delete from customers where id = ?";
Connection connection = null;
try {
connection = JDBCTools.getConnection();
System.out.println(connection);
System.out.println(queryRunner);
int i = queryRunner.update(connection, sql,1);
if(i > 0){
System.out.println("成功");
}else {
System.out.println("失败");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
JDBCTools.releaseDB(null, null, connection);
}