title: Operation not allowed after ResultSet closed, mysql
body: <p>Whenever I try and run this code I get: "java.sql.SQLException: Operation not allowed after ResultSet closed".  It works without closing the connection but i'm curious as to why I get this error and what would be the correct way to close the connection, Here is the code:</p>
  
  <pre><code>    public ResultSet UpdateTable(){
  
              Connection con = connect();
              ResultSet resultset;
              Statement s = null;
              resultset = null;
          try{
              s = con.createStatement();
              resultset =  s.executeQuery("select * from customera");
              return resultset;
  
              }
          catch(SQLException e){
              System.out.println(e.getMessage());
              //con.close();
          }
          finally{
              try{
                  s.close();
                  resultset.close();
                  con.close();
              }
              catch(SQLException e){
                  System.out.println(e.getMessage());
              }
          }
          return null;
      }
  
  }
  </code></pre>