title: Why the database row data not visible in the JavaFX TableView
body: <p>Hello i have an issue i am trying to display data from database into a <code>TableView</code> using Java because i couldn't find in <code>JavaFx</code> anything like a DataGridView in C#.
  I made the following method to fill the table:</p>
  
  <pre><code>private void fillTableView() throws SQLException {
          // fill header      
          for (int i = 2; i &lt;= resultSet.getMetaData().getColumnCount(); i++) {
              TableColumn column = new TableColumn(resultSet.getMetaData().getColumnName(i));
              tableView.getColumns().addAll(column);
          }       
  
          // fill rows
          while (resultSet.next()) { // loop through the rows by one
              ObservableList&lt;String&gt; row = FXCollections.observableArrayList();
              for (int i = 2; i &lt;= resultSet.getMetaData().getColumnCount(); i++) { // loop through the cells of each row    
                  // add the value of this cell to the valueToAdd string
                  row.add(resultSet.getString(i));
              }
              tableView.getItems().add((row));
              //rows.add(rows);
          }
          //tableView.setItems(rows);
      }
  </code></pre>
  
  <p>The first part works good and the column names are visible however, the rows of data appear empty yet they could be selected, so i can select the first 5 rows in the <code>TableView</code> ( I have five rows in my <code>ResultSet</code>) but those rows appear empty. I tried to remove this part</p>
  
  <pre><code>tableView.getItems().add((row));
  </code></pre>
  
  <p>And instead un-comment the two lines of code below it but still it didn't work.
  I tried to make objects initialized with the values from the database then add the objects to the <code>TableView</code> rather than adding an <code>ObservableList</code> of strings representing the rows as follows but still gave the same result (empty rows)</p>
  
  <pre><code>while (resultSet.next()) {
              Employee employee = new Employee(resultSet.getInt(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4));
              tableView.getItems().add(employee);
          }
  </code></pre>
  
  <p>Can someone tell me what am i doing wrong please ?</p>
  
  <p>I am using Netbeans 8, Scene builder, Java 8 and JavaDB (aka Apache Derby).</p>