Class ResultTable

  • All Implemented Interfaces:
    java.lang.Iterable<ResultTable.ResultRow>

    public final class ResultTable
    extends java.lang.Object
    implements java.lang.Iterable<ResultTable.ResultRow>
    Represents the results of the query along with its metadata. Basically a detached version of ResultSet.
    • Method Detail

      • getRowCount

        public int getRowCount()
      • getColumnCount

        public int getColumnCount()
      • get

        public java.lang.Object get​(int row,
                                    int column)
        Returns the value of given column of given row. Both indices are zero-based.
      • get

        public java.lang.Object get​(int row,
                                    @NotNull
                                    @NotNull java.lang.String column)
        Returns the value of given named column of given row.
      • getColumnNames

        @NotNull
        public @NotNull java.util.List<java.lang.String> getColumnNames()
      • getColumnTypes

        @NotNull
        public @NotNull java.util.List<java.lang.reflect.Type> getColumnTypes()
      • getRawColumnTypes

        @NotNull
        public @NotNull java.util.List<java.lang.Class<?>> getRawColumnTypes()
      • toString

        @NotNull
        public @NotNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringFormatted

        @NotNull
        public @NotNull java.lang.String toStringFormatted()
        Returns a formatted representation of this table. See formatTo(Appendable) for details of the format.
        See Also:
        formatTo(Appendable)
      • formatTo

        public void formatTo​(@NotNull
                             @NotNull java.lang.Appendable out)
                      throws java.io.IOException
        Pretty prints this table to out in a format suitable for console. Overly long columns are truncated and some effort is taken to make the result readable, but you should not depend on the exact details of the layout, since it might change.

        Hint: the output format is rouhgly that of Markdown tables, so you can use the result in your Markdown-documents. However, data is not escaped, since it's primarily meant to be written to console where escaping would hinder readability. Therefore, you might need to make manual adjustments to output if interpreting it as Markdown.

        Throws:
        java.io.IOException
        See Also:
        toStringFormatted()