I have a consumer that can say he doesn't want to process more data.
I've looked upon the methods in Spring JdbcTemplate
, but I see no way to inform Spring I don't want to process more rows when I'm on callback.
I could throw an exception, but then the jdbcTemplate.query(...)
would rethrow this exception, which is the behavior I don't wish.
Is there any way to force stop processing rows without causing exception?
jdbc.query(sql, new RowCallbackHandler() {
@Override
public void processRow(ResultSet rs) throws SQLException
{
// TODO how to stop if I want to do it here?
}}
);