67,513
社区成员
发帖
与我相关
我的任务
分享
String sql1="delete * from A where name=?";
String sql2="delete * from B where id=?";
connection=SQLHelper.getConnection();
connection.setAutoCommit(false);
preparedStatement=SQLHelper.getPrepareStatement(connection,sql1);
preparedStatement.setInt(1, name);
preparedStatement.executeUpdate();
preparedStatement=SQLHelper.getPrepareStatement(connection,sql2);
preparedStatement.setInt(1, id);
preparedStatement.executeUpdate();
connection.commit();