Operation not allowed after ResultSet closed (JSP)
<p>This piece of code is giving me error that operation can not be performed after result set is closed. I do not understand what is going wrong. Thanks in advance.</p>

<pre><code>&lt;%@page import="java.sql.*"%&gt;
&lt;%
  String username = request.getParameter("username");
  String password = request.getParameter("password");

    //JDBC CODE
  try{
     Class.forName("com.mysql.jdbc.Driver");
      Connection conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/**", "****", "******");
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    ResultSet rs = stmt.executeQuery("select * from add_user_table where name='"+username+"' and password='"+password+"'");
    if(rs.next())
    {
      String name=rs.getString("name");
      String pass = rs.getString("password");
      if(username.equals(name) &amp;&amp; password.equals(pass))
      {
         session.setAttribute("username",username);
         response.sendRedirect("any.jsp");
      }
      else
      {
        response.sendRedirect"any2.jsp?msg=Invalid");
      }
    }
  else
  {
      response.sendRedirect("any2.jsp?msg=Invalid");
  }
}
catch(Exception e)
{
    e.printStackTrace();
}
%&gt;
</code></pre>