Skip to content

Instantly share code, notes, and snippets.

@herhor
Created June 10, 2015 20:35
Show Gist options
  • Save herhor/5a103a321115571643d8 to your computer and use it in GitHub Desktop.
Save herhor/5a103a321115571643d8 to your computer and use it in GitHub Desktop.
AAL3.sharedJdbcTemplate.java
public class MyJdbcDaoImpl extends JdbcDaoSupport implements MyJdbcDao {
@Override
protected void initTemplateConfig() {
getJdbcTemplate().setFetchSize(200);
}
public MyResult loadAll() {
final MyResult result = new MyResult();
getJdbcTemplate().query("select a, b, c from table",
new RowCallbackHandler() {
@Override
public void processRow(ResultSet rs) throws SQLException {
...
result.add(...);
}
}
);
} // end of loadAll
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment