GeeCON Prague 2014*
The moose likes JDBC 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
Bookmark "setFetchSize() ??" Watch "setFetchSize() ??" New topic
Author

setFetchSize() ??

Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159
Hi,

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.

Thanks


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)
 
GeeCON Prague 2014
 
subject: setFetchSize() ??