Reputation: 15341
So far I have been using 'SimpleJdbcTemplate' and used a 'RowCallbackHadler' to process the whole result of the query. At the moment I would like to receive an iterator-like object, which I could query for the next table row whe interested. Is the following behaviour possible in Spring/jdbc (preferrably slpring)?
Upvotes: 4
Views: 3799
Reputation: 62652
You can try using the JdbcTemplate method queryforRowSet
public SqlRowSet queryForRowSet(String sql,
Object... args)
throws DataAccessException
Upvotes: 1
Reputation: 20316
You can use a ResultSetExtractor instead of a RowCallbackHadler
. Methods in JdbcTemplate
accepting the latter will accept the former too.
Upvotes: 1