Interface ResultSetAccumulator<T>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ResultSetAccumulator<T>
    A ResultSetAccumulator repeatedly combines rows from the given ResultSet to produce a single result. jdbi will advance the ResultSet between each method invocation, so don't call ResultSet.next() please.
    • Method Detail

      • apply

        T apply​(T previous,
                java.sql.ResultSet rs,
                StatementContext ctx)
         throws java.sql.SQLException
        Extract a single row from the result set, and combine it with the accumulator to produce a result.
        Parameters:
        previous - the previous object
        rs - the ResultSet, please do not advance it
        ctx - the statement context
        Returns:
        the accumulated value
        Throws:
        java.sql.SQLException - in the face of grave danger