File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes setFetchSize() ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "setFetchSize() ??" Watch "setFetchSize() ??" New topic

setFetchSize() ??

Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159

If I am using setMaxRows() or setFetchSize(), how will i know if there are more rows to be retrived.
I do not want to fire a query with count(*) and compare.


The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
Joe Nguyen
Ranch Hand

Joined: Apr 20, 2001
Posts: 161
setFetchSize() has nothing to do with the number of rows you can retrieve in your select statement. setFetchSize() only suggests the number of rows fetch over from db server to app server in each round trip. setMaxRow() indicates your resultset can accomodate only this number of rows. If your query returns more rows than the value you set, the extra rows will be drop. If resultset.size() < the value you set, you know you get every record. If resultset.size() == the value you set, you may or may not get every record (more likely you may not)
I agree. Here's the link:
subject: setFetchSize() ??
It's not a secret anymore!