title: Store rows of resultset in array of strings
body: <p>I want to count the numbers of entries in resultset and then store these values in an array and pass this array to create a graph.</p>
  
  <pre><code>     ResultSet rs = stmt.executeQuery( "SELECT distinct "+jTextField.getText()+" as 
       call from tablename"); // this statement will select the unique entries in a 
                                particular column provided by jtextfield
  
       int count=0;
  
       while(rs.next())
         { ++count; } // This will count the number of entries in the result set.
  </code></pre>
  
  <p>Now I want to store the values of result set in an array of string. I used the following code</p>
  
  <pre><code>    String[] row = new String[count];
      while(rs.next())
       {
         for (int i=0; i &lt;columnCount ; i++)
          {
            row[i] = rs.getString(i + 1);
          }
       }
  </code></pre>
  
  <p>Error : Invalid Descriptor Index.
  Please suggest how to copy the result of resultset in array.</p>
  
  <p>For example if I enter priority in jTextField , the result set will contain
  priority1
  priority2
  priority3</p>