How Fill a TableView with a ResultSet?
872262Jun 29 2011 — edited Jul 2 2011I have a query, whose number of columns changes depending on the outcome of the ResultSet. My query finds a word in a different table and a different field each time.
h3. rs = stmt.executeQuery("SELECT * FROM " + table + " WHERE " + field + " LIKE " + "'%" + search + "%'" );
So I make a tableView to put all data. But every query return a different number of columns and I can't build the tableView.
Someone knows a way to create the columns with the number of columns that gets with the function
h3. rs.getMetaData.getColumnCount();
h2. how fill a tableView with a ResultSet??