title: resultset to get values from next row
body: <p>hi i'm new to java how ever i googled and got code to connect to database and retrieve the values.</p>
  
  <p>the problem is <code>ResultSet</code> gets the value only from <strong>FIRST ROW</strong> of the table</p>
  
  <p>here is the code..</p>
  
  <pre><code>String stmt = "select * from tablename";
  ResultSet resultSet = statement.executeQuery(stmt);
  while(resultSet.next())
   {
      String val = resultSet.getString(3);
      System.out.println(val);
   } 
  </code></pre>
  
  <p>it returns only the 3rd value (because i have mentioned that and i need that column value only) of the first row, but i <strong>need to get the every 3rd value (column) of every row and store it in a array</strong>.</p>