title: Write more than one database results to csv file
body: <p>I am writing the result set of 1st database query result set to first 2 columns of csv file. </p>
  
  <p>Then I am trying to write header name 'HSS1' in third column of csv which is going to have result set of another database table. Am not doing  the second step the right way.</p>
  
  <p>1st step:</p>
  
  <pre><code>        fw = new FileWriter(filename);
          fw.append("CID");
          fw.append(',');
          fw.append("Uniques");
          fw.append('\n');
  
          rs=stmt.executeQuery(sql);
  
              while(rs.next()){
  
                  fw.append(rs.getString(1));
                  fw.append(',');
                  fw.append(rs.getString(2));
                  fw.append('\n');
                  fw.flush();
  </code></pre>
  
  <p>Writing header name in csv file for the second database query</p>
  
  <p>second step</p>
  
  <pre><code>try{
  
      fw.append(",");
      fw.append(",");
      fw.append("HSS1");
      fw.append('\n');
  
      fw.close();
  </code></pre>
  
  <p>HSS1 gets written to 3rd column but it's not the header.</p>
  
  <p>Thanks</p>