Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christian-posta/ea2e90eeab7dd23b626fac2c107250df to your computer and use it in GitHub Desktop.
Save christian-posta/ea2e90eeab7dd23b626fac2c107250df to your computer and use it in GitHub Desktop.
How to limit prepared statement in camel-sql
package org.apache.camel.component.sql;
public class FetchLimitedPreparedStatementStrategy extends DefaultSqlPrepareStatementStrategy {
public FetchLimitedPreparedStatementStrategy() {
}
@Override
public void populateStatement(PreparedStatement ps, Iterator<?> iterator, int expectedParams) throws SQLException {
ps.setFetchSize(1000);
super.populateStatement(ps, iterator, expectedParams);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment