aspose file tools*
The moose likes JDBC and the fly likes Setting fetch size for fast retrieval of data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Setting fetch size for fast retrieval of data" Watch "Setting fetch size for fast retrieval of data" New topic
Author

Setting fetch size for fast retrieval of data

Jotty Tharakan
Greenhorn

Joined: Dec 14, 2001
Posts: 17
I have a doubt implementing setting the fetch size.I set the fetch size for statement and result set as follows.
statement.setFetchSize(300);
rs.setFetchSize(300);
but if i'm changing(increase or decrease) fetchsize of statement as well as rs , the time required for processing increase ,and i found that this combination gaves the better result.Number of records fetched is 304.
Why it is behaving like this ? can any one help me ?
is there any connection between number of rows expected and fetch size.If it is then suggest me how to find suitable combination.
We are using connection pool from an application server.
Also if i'm using a cachedrowset how can i set the fetchsize if i'm using rowset.exceuteonnection con);
Rgds
George
 
Consider Paul's rocket mass heater.
 
subject: Setting fetch size for fast retrieval of data