code: public static String resultSetToString(ResultSet resultSet) throws IllegalAccessException {
      StringBuilder resultSetStringBuilder = new StringBuilder();
      List<String[]> resultSetStringArrayList = resultSetToStringArrayList(resultSet);
      List<Integer> maxColumnSizes = getMaxColumnSizes(resultSetStringArrayList);
      String rowTemplate = createRowTemplate(maxColumnSizes);
      String rowSeparator = createRowSeperator(maxColumnSizes);
  
      resultSetStringBuilder.append(rowSeparator);
      for (int i = 0; i < resultSetStringArrayList.size(); i++) {
        resultSetStringBuilder
            .append(String.format(rowTemplate, (Object[]) resultSetStringArrayList.get(i)))
            .append(rowSeparator);
      }
      return resultSetStringBuilder.toString();
    }
docs: Gets the result set as a table representation in the form of:
  
  <pre>
  +-------+-------+-------+
  |column1|column2|column3|
  +-------+-------+-------+
  |value1 |value2 |value3 |
  +-------+-------+-------+
  |value1 |value2 |value3 |
  +-------+-------+-------+
  </pre>
  
  @param resultSet the result set to display as a string
  @return the string representation of result set as a table
  @throws IllegalAccessException if the values of the result set cannot be accessed