October 2017
Intermediate to advanced
396 pages
10h 2m
English
Spring provides a simpler RowCallbackHandler interface when there is no return object. It is used to stream rows to a file, converting the rows to XML, and filtering them before adding to a collection. But filtering in SQL is much more efficient, and is faster than the JPA equivalent for big queries. Let's look at the following example:
public interface RowCallbackHandler {
void processRow(ResultSet rs) throws SQLException;
}
Example for using a RowCallbackHandler
The following code is an example of a RowCallbackHandler in the application:
package com.packt.patterninspring.chapter7.bankapp.callbacks; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.jdbc.core.RowCallbackHandler; ...
Read now
Unlock full access