Connection cn = DriverManager.getConnection("jdbc:derby://localhost:1527/sample","root","root"); Statement st = cn.createStatement(); ResultSet rs = st.executeQuery("SELECT * FROM Quizz"); int count = 0, qno = 0; while (rs.next()) { qno++; if(rs.getString(7).equals(request.getParameter(" "+(++qno)))) { count++; out.println("