public boolean deleteTest(int test_id) throws DBException { PreparedStatement pstmt = null; Connection con = null; ResultSet rs = null; boolean deleteStatus = false; try { con = getConnection(); pstmt = con.prepareStatement(SQL_DELETE_TEST); pstmt.setInt(1, test_id); pstmt.executeUpdate(); con.commit(); LOG.debug("Test deleted"); deleteStatus = true; } catch (SQLException ex) { rollback(con); LOG.error("Cannot delete test", ex); } finally { close (rs); close(pstmt); close(con); } return deleteStatus; }