Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Statement.setfetchSize() Doubt  RSS feed

 
Ranch Hand
Posts: 64
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am not fully fluent with the JDBC methods, so please guide me.
While using the methods Statement.setFetchSize(int i) or Resultset.setFetchSize(int i)
we can set the no of rows fetched at a time for all result sets of this statement.
This helps in decreasing the load on the db server. but if one has to fetch 100 rows and the fetch size is set.
how will the rest rows be fetched like...
for example i have a table 'testTable' which has a primary key Id.
when a query is executed the rows fetched will be rows till Id = 30 then next fetched rows should be from the primary key 31.
How is this understood by the db server.
I will be very grateful if some examples is provided.

Thanks in advance.
 
Ranch Hand
Posts: 57
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this out this may help

http://faq.javaranch.com/java/PaginationOrPaging

[moderator changed from code tag to url tag]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!