title: how to filter tableview data from mysql database?
body: <p>I have this interface </p>
  
  <p><a href="https://imgur.com/ApJZtXe" rel="nofollow noreferrer">http://imgur.com/ApJZtXe</a></p>
  
  <p>and i want that when i write in the "Buscar" textfield, the data from the table changes according to the query, so far I have this code to populate the table</p>
  
  <pre><code>Statement st=null;
          ResultSet rs;
  
          try{
              Connection miConexion= (Connection) Conectar.GetConnection(); //conexion de la base de datos que se manda llamar
  
              st = (Statement) miConexion.createStatement();
              data = FXCollections.observableArrayList();
  
              rs = st.executeQuery("select * from accesorios ");
  
              for(int i=0 ; i&lt;rs.getMetaData().getColumnCount(); i++){
  
                  //We are using non property style for making dynamic table
  
                  final int j = i;
  
                  TableColumn col = new TableColumn(rs.getMetaData().getColumnName(i+1));
  
                  col.setCellValueFactory(new Callback&lt;TableColumn.CellDataFeatures&lt;ObservableList,String&gt;,ObservableValue&lt;String&gt;&gt;(){
  
                      public ObservableValue&lt;String&gt; call(TableColumn.CellDataFeatures&lt;ObservableList, String&gt; param) {
  
                          return new SimpleStringProperty(param.getValue().get(j).toString());
  
                      }
  
                  });
  
  
  
                  tableView.getColumns().addAll(col);
  
                  System.out.println("Column ["+i+"] ");
  
              }
  
              /********************************
               60
               * Data added to ObservableList *
               61
               ********************************/
  
              while(rs.next()){
  
                  //Iterate Row
  
                  ObservableList&lt;String&gt; row = FXCollections.observableArrayList();
  
                  for(int i=1 ; i&lt;=rs.getMetaData().getColumnCount(); i++){
  
                      //Iterate Column
  
                      row.add(rs.getString(i));
  
                  }
  
                  System.out.println("Row [1] added "+row );
  
                  data.add(row);
  
  
  
              }
  
  
  
              //FINALLY ADDED TO TableView
  
              tableView.setItems(data);
  
          }catch(Exception e){
  
              e.printStackTrace();
  
              System.out.println("Error on Building Data");
  
          }
  
      }
  </code></pre>
  
  <p>If you could give me some orientation on how to do it, that would be great thank you for your help</p>