现在的位置: 首页 > 综合 > 正文

JDBC ResultSet setFetchSize

2013年09月04日 ⁄ 综合 ⁄ 共 897字 ⁄ 字号 评论关闭

 

 

When testing in Oracle, above loop is very slow. If add setFetchSize before next,  the performance improve significantly 

 

 

 

ResultSet interface also provides batch retrieval facility like Statement as mentioned above. It overrides the Statement behaviour.

Initially find the default size by using

ResultSet.getFetchSize(); and then set the size as per requirement

ResultSet.setFetchSize(50);

This feature significantly improves performance when you are dealing with retrieval of large number of rows like search functionality.

 

TODO: reading full tips

http://www.precisejava.com/javaperf/j2ee/JDBC.htm#JDBC114

 

 

抱歉!评论已关闭.