title: java exception: Operation not allowed after ResultSet closed
body: <p>i have the following exception:
  <img src="https://i.stack.imgur.com/iuk5I.jpg" alt="enter image description here"></p>
  
  <p>here is the relevant code parts:
  Server.Proxy.update_allLogOut: (line 65 is the while bracket)</p>
  
  <pre><code>    public void update_allLogOut ()
  {
      try 
      {
          ResultSet rs;
          stmt = conn.createStatement();
          rs = stmt.executeQuery("SELECT * FROM sysuser WHERE login=1");
          while(rs.next())
          {
              stmt.executeUpdate("UPDATE sysuser SET login=0");
          }
          rs.close();
      } catch (SQLException e) {e.printStackTrace();}
  
  }   
  </code></pre>
  
  <p>Server.Server.:</p>
  
  <pre><code>      public Server(int port) 
   {
      super(port);
      func.update_allLogOut();
    }
  </code></pre>
  
  <p>main:</p>
  
  <pre><code>Server sv = new Server(5555);
  </code></pre>
  
  <p>i must point out that 99% of times it runs with no exceptions.. but several times i get this exception that i cant figure out why it happens. any ideas? it is clear that something is done wrong yet all similar topics here have not given the answer in this case...</p>