Class SQLExecResult


  • public class SQLExecResult
    extends Object
    Result from SQLExec containing tables, columns, column widths, rows, and values
    Since:
    3.3.0
    Author:
    osbornb
    • Constructor Detail

      • SQLExecResult

        public SQLExecResult()
        Constructor
    • Method Detail

      • addTable

        public void addTable​(String table)
        Add a table
        Parameters:
        table - table name
      • getTables

        public List<String> getTables()
        Get the tables
        Returns:
        table names
      • addColumn

        public void addColumn​(String column)
        Add a column
        Parameters:
        column - column name
      • addColumn

        public void addColumn​(int index,
                              String column)
        Add a column
        Parameters:
        index - column index
        column - column name
        Since:
        5.0.0
      • addColumns

        public void addColumns​(Collection<String> columns)
        Add columns
        Parameters:
        columns - column names
      • numColumns

        public int numColumns()
        Get the number of columns
        Returns:
        column count
      • getColumns

        public List<String> getColumns()
        Get the columns
        Returns:
        column names
      • getColumn

        public String getColumn​(int index)
        Get the column name at the index
        Parameters:
        index - column index
        Returns:
        column name
      • hasColumns

        public boolean hasColumns()
        Determine if the results have any columns
        Returns:
        true if has columns
      • getMaxColumnWidth

        public Integer getMaxColumnWidth()
        Get the max column width
        Returns:
        max column width
        Since:
        4.0.0
      • setMaxColumnWidth

        public void setMaxColumnWidth​(Integer maxColumnWidth)
        Set the max column width
        Parameters:
        maxColumnWidth - max column width
        Since:
        4.0.0
      • getMaxLinesPerRow

        public Integer getMaxLinesPerRow()
        Get the max lines per row
        Returns:
        max lines per row
        Since:
        4.0.0
      • setMaxLinesPerRow

        public void setMaxLinesPerRow​(Integer maxLinesPerRow)
        Set the max lines per row
        Parameters:
        maxLinesPerRow - max lines per row
        Since:
        4.0.0
      • addColumnWidth

        public void addColumnWidth​(int width)
        Add a column width
        Parameters:
        width - column width
      • addColumnWidth

        public void addColumnWidth​(int index,
                                   int width)
        Add a column width
        Parameters:
        index - column index
        width - column width
        Since:
        5.0.0
      • addColumnWidths

        public void addColumnWidths​(int[] widths)
        Add the column widths
        Parameters:
        widths - column widths
      • getColumnWidths

        public List<Integer> getColumnWidths()
        Get the column widths
        Returns:
        column widths
      • getColumnWidth

        public int getColumnWidth​(int index)
        Get the column width at the index
        Parameters:
        index - column index
        Returns:
        column width
      • addRow

        public void addRow​(List<String> row)
        Add a row
        Parameters:
        row - result row
      • numRows

        public int numRows()
        Get the number of rows
        Returns:
        number of rows
      • hasRows

        public boolean hasRows()
        Determine if the results have any rows
        Returns:
        true if has rows
      • getRows

        public List<List<String>> getRows()
        Get the rows
        Returns:
        result rows
      • getRow

        public List<String> getRow​(int index)
        Get the row at the row index
        Parameters:
        index - row index
        Returns:
        result row
      • addRowValue

        public void addRowValue​(int index,
                                String value)
        Add a row value
        Parameters:
        index - row index
        value - value
        Since:
        5.0.0
      • addRowValue

        public void addRowValue​(int index,
                                int columnIndex,
                                String value)
        Add a row value
        Parameters:
        index - row index
        columnIndex - column index
        value - value
        Since:
        5.0.0
      • getValue

        public String getValue​(int rowIndex,
                               int columnIndex)
        Get the value at the row and column index
        Parameters:
        rowIndex - row index
        columnIndex - column index
        Returns:
        value as a string
      • setUpdateCount

        public void setUpdateCount​(Integer updateCount)
        Set the update count
        Parameters:
        updateCount - update count
      • getUpdateCount

        public Integer getUpdateCount()
        Get the update count
        Returns:
        update count
      • hasUpdateCount

        public boolean hasUpdateCount()
        Check if has an update count
        Returns:
        true if has an update count
      • setMaxRows

        public void setMaxRows​(Integer maxRows)
        Set the max rows queried
        Parameters:
        maxRows - max rows
      • getMaxRows

        public Integer getMaxRows()
        Get the max rows queried
        Returns:
        max rows
      • hasMaxResults

        public boolean hasMaxResults()
        Determine if the result has the max number of results
        Returns:
        true if max results
      • isPrintSides

        public boolean isPrintSides()
        Is the print sides flag enabled
        Returns:
        true to print sides
      • setPrintSides

        public void setPrintSides​(boolean printSides)
        Set the print sides flag
        Parameters:
        printSides - true to print sides
      • printResults

        public void printResults()
        Print the results using System.out