title: Invalid operation: result set is closed
body: <p>When my resultset data is large I get 
  <code>com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][4.9.78] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null</code> exception but not when I try with less amount of data in resultset</p>
  
  <p>Below is my code snippet</p>
  
  <pre><code>ResultSet rs=null;
  String sql_query="select * from exception_main;select * from m_roles"
  String query1=sql_query.toUpperCase();
  String[] results=query1.split(";");         
  CSVWriter writer = new CSVWriter(new FileWriter(csv_file_path + csv_file_name), ',',CSVWriter.NO_QUOTE_CHARACTER);                     
  for(int i=0;i&lt;results.length;i++)                         
  {                             
    if(results[i].startsWith("SELECT"))                             
    {                                 
      System.out.println("Inside select"+ results[i]);                             
  
      ps = conn1.prepareStatement(results[i].toString());                             
      rs = ps.executeQuery();             
  
      ...                        
  
      //writing to csv file                          
      System.out.println("Count..." + rs.getRow());                        
      writer.writeAll(rs, true);                         
  
      while(rs.next()){                                  
        rs.deleteRow();                                
      }                          
      System.out.println("Count...3:::::::" + rs1.getRow());     
    }     
  }
  writer.close(); 
  rs.close();
  </code></pre>