code: private <A> TableData<A> tableData(final ResultSet rs,
                                         final RowFunction<A> f)
          throws SQLException {
  
          final ResultSetMetaData meta = rs.getMetaData();
          final int c = meta.getColumnCount();
          final TableData<A> td = new TableData<A>();
  
          for (int p = 1; p <= c; p++) {
              final String n = meta.getColumnLabel(p);
              td.columns.add((n == null || "".equals(n)) ? "col" + p : n);
          } // end of for
  
          // First row
          td.rows.add(f.apply(rs));
  
          // Other row(s)
          while (rs.next()) {
              td.rows.add(f.apply(rs));
          } // end of if
  
          return td;
      }
docs: Returns table data from |result| set.