Class SimpleResultSet<T>

java.lang.Object
org.itsallcode.jdbc.resultset.SimpleResultSet<T>
Type Parameters:
T - row type
All Implemented Interfaces:
AutoCloseable, Iterable<T>

public class SimpleResultSet<T> extends Object implements AutoCloseable, Iterable<T>
This class wraps a ResultSet and allows easy iteration via Iterator, List or Stream.
  • Constructor Details

    • SimpleResultSet

      public SimpleResultSet(Context context, ResultSet resultSet, ContextRowMapper<T> rowMapper, AutoCloseable statement)
      Create a new instance.
      Parameters:
      context - database context
      resultSet - the underlying result set
      rowMapper - a row mapper for converting each row
      statement - the statement that created the result set. This will be closed when the result set is closed.
  • Method Details