Announcement Announcement Module
Collapse
No announcement yet.
Multi-row fetch with DB2? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 http://publib.boulder.ibm.com/infoce...c/rjvdsprp.htm and http://publib.boulder.ibm.com/infoce...c_c0052058.htm

    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="com.ibm.db2.jcc.DB2Driver" />
    ...
    <property name="connectionProperties" value="enableRowsetSupport=1" />
    </bean>
    also tried
    <property name="connectionProperties" value="enableRowsetSupport=0;useRowsetCursor=true; " />


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