Package com.landawn.abacus.jdbc
Interface Jdbc.RowConsumer
- All Superinterfaces:
com.landawn.abacus.util.Throwables.Consumer<ResultSet,
SQLException>
- Enclosing class:
- Jdbc
- 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 static interface Jdbc.RowConsumer
extends com.landawn.abacus.util.Throwables.Consumer<ResultSet,SQLException>
Don't use
RowConsumer
in AbstractPreparedQuery.forEach(RowConsumer)
or any place where multiple records will be consumed by it, if column labels/count are used in accept(ResultSet)
.
Consider using BiRowConsumer
instead because it's more efficient to consume multiple records when column labels/count are used.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
default Jdbc.RowConsumer
andThen
(com.landawn.abacus.util.Throwables.Consumer<? super ResultSet, SQLException> after) static Jdbc.RowConsumer
oneOff
(Class<?> entityClass, Consumer<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray> consumer) It's stateful.static Jdbc.RowConsumer
It's stateful.default Jdbc.BiRowConsumer
Methods inherited from interface com.landawn.abacus.util.Throwables.Consumer
unchecked
-
Field Details
-
DO_NOTHING
-
-
Method Details
-
accept
- Specified by:
accept
in interfacecom.landawn.abacus.util.Throwables.Consumer<ResultSet,
SQLException> - Parameters:
rs
-- Throws:
SQLException
-
andThen
default Jdbc.RowConsumer andThen(com.landawn.abacus.util.Throwables.Consumer<? super ResultSet, SQLException> after) - Parameters:
after
-- Returns:
-
toBiRowConsumer
- Returns:
-
oneOff
@Beta @SequentialOnly @Stateful static Jdbc.RowConsumer oneOff(Consumer<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray> consumer) It's stateful. Don't save or cache the returned instance for reuse or use it in parallel stream.- Parameters:
consumer
-- Returns:
-
oneOff
@Beta @SequentialOnly @Stateful static Jdbc.RowConsumer oneOff(Class<?> entityClass, Consumer<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray> consumer) It's stateful. Don't save or cache the returned instance for reuse or use it in parallel stream.- Parameters:
entityClass
- used to fetch column/row value fromResultSet
by the type of fields/columns defined in this class.consumer
-- Returns:
-