public boolean deleteBooks(List idList) {
Connection con = null;
boolean isSuccess = true;
try {
con = DBUtil.getConnection();
con.setAutoCommit(false);
for (int i = 0; i < idList.size(); i++) {
int bookId = (Integer)idList.get(i); dao.delBook(con, bookId);
}
con.commit();
} catch (Exception e) {
try {
con.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
isSuccess = false;
e.printStackTrace();
} finally {
try {
if (con != null) {
con.close();
}
} catch (SQLException e) {
}
}
return isSuccess;
}大家帮帮忙,看看怎么回事啊