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)?
You can use a ResultSetExtractor instead of a RowCallbackHadler
. Methods in JdbcTemplate
accepting the latter will accept the former too.
You can try using the JdbcTemplate method queryforRowSet
public SqlRowSet queryForRowSet(String sql,
Object... args)
throws DataAccessException
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.