title: How to add column in resultset in java?
body: <p>I have table employee</p>
  
  <p>I retrieve the columns as  <code>select emp_name,emp_add from employee</code></p>
  
  <pre><code>while(iResultSet1.next())
              {
                  List expRptColWise = new ArrayList();
  
                  for(Integer i=1;i&lt;=iResultSet1.getMetaData().getColumnCount();i++){
  
  
                          expRptColWise.add(iResultSet1.getString(i));
  
                  }
  
                  expRptRowWise.add(expRptColWise);
  </code></pre>
  
  <p>With the above snippet ,I get</p>
  
  <pre><code>emp_name | emp_add |
  A        | add1    |
  B        | add2    |
  </code></pre>
  
  <p>I want to add Serial No. coloumn in resultset so that I get result as</p>
  
  <pre><code>emp_name | emp_add |Sr_No|
  A        | add1    |1    |
  B        | add2    |2    |
  </code></pre>
  
  <p>Please guide me how to add column dynamically in resultset or collection object ,Here I have used ArrayList.</p>