Class ResultIterator

    • Method Detail

      • getCurrentRowCount

        public int getCurrentRowCount()
        Retrieves the number of rows processed by the iterator so far. If the iteration hasn't started, this method returns 0.
        Returns:
        The number of rows processed by the iterator so far or 0 if the iteration hasn't started.
      • next

        public Map<String,​ResultColumn> next()
                                            throws DatabaseEngineException
        Retrieves the next row in the result set.

        This method also closes the result set upon the last call on the result set.

        If the statement in place is not a PreparedStatement it also closes the statement.

        If an exception is thrown the calling thread is responsible for repeating the action in place.

        Returns:
        The result row.
        Throws:
        DatabaseEngineException - If a database access error occurs.
      • isClosed

        public boolean isClosed()
        Checks if this result iterator is closed.
        Returns:
        true if the result set is closed, false otherwise.
      • getColumnNames

        public List<String> getColumnNames()
        Retrieves the column names of the iterator.
        Returns:
        the column names of the iterator.
      • cancel

        public boolean cancel()
        Attempts to cancel the current query. This relies on the JDBC driver supporting Statement.cancel(), which is not guaranteed on all drivers. A possible use case for this method is to implement a timeout; If that's the case, see also AbstractDatabaseEngine.iterator(String, int, int) for an alternative way to accomplish this. This method is expected to be invoked from a thread distinct of the one that is reading from the result set.
        Returns:
        true if the query was cancelled, false otherwise.
      • createResultColumn

        public abstract ResultColumn createResultColumn​(String name,
                                                        Object value)
        Creates a ResultColumn for the given engine in place.
        Parameters:
        name - The name of the column.
        value - The value on the column.
        Returns:
        A specific result column given the implementation.