code: static Set<String> labels(final ResultSet results) throws SQLException {
          final ResultSetMetaData metadata = results.getMetaData();
          final int count = metadata.getColumnCount();
          final Set<String> labels = new HashSet<>(count);
          for (int i = 1; i <= count; i++) {
              labels.add(metadata.getColumnLabel(i).toUpperCase());
          }
          return labels;
      }
docs: Returns a set of column labels of given result set.
  
  @param results the result set from which column labels are read.
  @return a set of column labels
  @throws SQLException if a database error occurs.
  @see ResultSet#getMetaData()