title: Populating TableView in JavaFX
body: <p>I am a newbie in here, my Table View in JavFX namely as tblStudent is NOT containing the<br>
   records that I want. How to do this, please help me.</p>
  
  <pre><code>    public void populateData(){
        Connection c ;
        data = FXCollections.observableArrayList();
        try{
          c = ConnectionClass.connect();
          //SQL FOR SELECTING ALL OF CUSTOMER
          String SQL = "SELECT * FROM `student`";
          //ResultSet
          ResultSet rs = c.createStatement().executeQuery(SQL);
  
  
          studentIDCol = new TableColumn("Student ID");
          nameCol = new TableColumn("Name");
          addressCol = new TableColumn("Address");
          ageCol = new TableColumn("Age");
          contactnoCol = new TableColumn("Contact Number");
  
          while(rs.next()){
              //Iterate Row
              ObservableList&lt;String&gt; row = FXCollections.observableArrayList();
  
              row.add(rs.getString("id"));
              row.add(rs.getString("name"));
              row.add(rs.getString("address"));
              row.add(rs.getString("age"));
              row.add(rs.getString("contact_num"));
  
              System.out.println("Row [1] added "+row );
              data.add(row);
  
          }
  
          //FINALLY ADDED TO TableView
          tblStudent.getItems().setAll(data);
        }catch(Exception e){
            e.printStackTrace();
            System.out.println("Error on Building Data");             
        }
   }
  </code></pre>
  
  <p>Anyone who knows this?</p>