- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Used with SqlQuery to process potentially large queries reading directly from the JDBC ResultSet.
This provides a low level option that reads directly from the JDBC ResultSet.
String sql = "select id, name, status from o_customer order by name desc";
DB.sqlQuery(sql)
.findEachRow((resultSet, rowNum) -> {
// read directly from ResultSet
long id = resultSet.getLong(1);
String name = resultSet.getString(2);
// do something interesting with the data
});
-
Method Summary
-
Method Details
-
accept
Read the data from the ResultSet and process it.- Parameters:
resultSet
- The JDBC ResultSet positioned to the current rowrowNum
- The number of the current row being mapped.- Throws:
SQLException
-