Announcement Announcement Module
No announcement yet.
Multi-row fetch with DB2? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multi-row fetch with DB2?

    I'm using Spring JdbcTemplate / DBCP with IBM DB2 Express-C database but can't seem to find a way to use multi-row fetching for select queries. Iterating the resultset is painfully slow as each row fetch requires a DB round trip.

    According to the DB2 docs at and

    this requires the JDBC property enableRowsetSupport=1 which I set in the DBCP datasource
    I set the fetch size using
    ((JdbcTemplate) getNamedJdbcTemplate().getJdbcOperations()).setFet chSize(1000);

    My DBCP setup is
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="" />
    <property name="connectionProperties" value="enableRowsetSupport=1" />
    also tried
    <property name="connectionProperties" value="enableRowsetSupport=0;useRowsetCursor=true; " />

    Has anyone been successfully done with with Spring Data and IBM DB2?