title: JDBC ResultSet - No data is available
body: <p>I'm new to java, i tried to print all data in the table</p>
  
  <pre><code>    Statement stmt=connection.createStatement();
      String sql ="INSERT INTO contacts(name,email)VALUES('ABC','ABC@yahoo.com')";
      stmt.execute(sql);
      ResultSet rs=stmt.executeQuery("SELECT*FROM contacts");
      System.out.println(rs.getString("name"));
  </code></pre>
  
  <p>and got </p>
  
  <pre><code>Exception in thread "main" org.h2.jdbc.JdbcSQLException: No data is available [2000-173]
  </code></pre>