This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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() ??
Similar Threads
Getting First n Records
Hql top
setFetchSize() ?
Scrollable pages
JDBC : java heap space exception