title: ResultSet showing empty but there is at least 1 record in the table
body: <p><strong>ISSUE</strong>  My ResultSet is empty but I know there is at least 1 record in the table (&quot;tblStudents&quot;)?</p>
  <p><strong>CODE</strong> :</p>
  <pre><code>package smartdatabase;
  
  /**
   *
   * @author travi
   */
  import java.sql.*;
  
  public class Conn {
  
      private Connection connect = null;
      private Statement stmt = null;
  
      public Conn() {
      }
  
      public void getStudents() {
          try {
  
              Class.forName(&quot;org.apache.derby.jdbc.ClientDriver&quot;);
              connect = DriverManager.getConnection(&quot;jdbc:derby://localhost:1527/SmartData&quot;, &quot;root&quot;, 
  &quot;password&quot;);
              String sql;
              sql = &quot;SELECT FirstName, Surname FROM tblStudents&quot;;
              stmt = connect.createStatement();
              ResultSet rs = stmt.executeQuery(sql);
  
              if (rs.next()) {
                  String Firstname = rs.getString(&quot;Firstname&quot;);
                  String Surname = rs.getString(&quot;surname&quot;);
                  System.out.println(Firstname + &quot;    &quot; + Surname);
              }else{
                  System.out.println(&quot;Empty ResultSet&quot;);
              }
          } catch (SQLException se) {
              se.printStackTrace();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  
  }
  </code></pre>
  <p>I have tried checking the case sensitivity and it doesn't seem to be the issue.</p>
  <p>I also tried <code>ResultSet rs = stmt.executeQuery(sql);</code> and it didn't change anything. Any ideas?</p>