title: ResultSet MetaData not returning first row
body: <p>This code returns every row apart from the first. I can't see what is wrong with it? How can i make it include the first?    </p>
  
  <pre><code>stmt = con.createStatement();  
  
  ResultSet res=stmt.executeQuery("SELECT * FROM Orders ORDER BY OrderID");
  
  if (res.next())
  {
      ResultSetMetaData rsmd=res.getMetaData();
      int columnCount=rsmd.getColumnCount();
      for (int i = 1; i&lt;= columnCount; i++) {
          columnHeading=columnHeading+"\t"+rsmd.getColumnName(i); 
      }
      System.out.println(columnHeading);
      while(res.next()) {
          for (int i= 1; i&lt;= columnCount; i++) {                            
              System.out.print("\t"+res.getString(i));
          }
      System.out.println("\n");
      }
  }
  </code></pre>