This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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)
 
 
subject: setFetchSize() ??
 
It's not a secret anymore!