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
提升Oracle查询性能
本文介绍了一种通过调整ResultSet的fetch size来显著提高Oracle数据库查询性能的方法,并解释了如何利用批处理检索设施进一步优化大量数据的检索过程。
918

被折叠的 条评论
为什么被折叠?



