title: Invalid state, the ResultSet object is closed
body: <p>I am running the code, however am getting a "Invalid state, the ResultSet object is closed." error.  What is causing the error?</p>
  
  <pre><code>try{
      query = "SELECT * FROM BUNDLE_TEMP "
                    + "MINUS "
                    + "SELECT * FROM BUNDLE";
  
              rs = stmt.executeQuery(query);
  
              while (rs.next()){
                  String bundle = rs.getString("BUNDLE");
                  String week = rs.getString("WEEK");
                  String sched_dt = rs.getString("SCHED_DT").replace(" 00:00:00.0", "");
                  String dropper_id = rs.getString("DROPPER_ID");
  
  
                  query = "INSERT INTO BUNDLE "
                              + "VALUES ('"
                                  + bundle+"','"
                                  + week+"','"
                                  + sched_dt+"','"
                                  + dropper_id+"')";
  
                  stmt.executeUpdate(query);
              }
          }catch(Exception e){
              System.out.println("Error while trying to insert into BUNDLE\n"+query+"\n"+ e);
          }
  </code></pre>