-
Dec 13th, 2012, 05:13 AM
#1
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?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules