skip to Main Content

Mysql – How to check for a condition within a while loop java

String valChecker = "SELECT * FROM `committee_memba` where (Rank= 'Chairperson' or Rank='Vice-Chair') and committee_name='" + jComboBox1.getSelectedItem().toString() + "'"; System.out.println(valChecker); PreparedStatement stmt = conn.prepareStatement(valChecker); rs = stmt.executeQuery(); while (rs.next()){ String rnk = rs.getString("Rank"); System.err.println(rnk); if ((rnk.equals("Chairperson") && rank.equals("Chairperson")) || (rnk.equals("Vice-Chair") &&…

VIEW QUESTION
Back To Top
Search