• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

setFetchSize() ?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Im using setFetchSize() in my code, but it doesnt have any impact.
I wanted to retrieve first 30 records first , then next 30 like that.
Once i got first 30 records im returning it as a collection , then in main program im checking if the size of the coolection is not zero retrive next 30 records.

But rs.setFetchSize(30) is retrieving all my records in the first execution itself. How can i implement this functionality with or without using rs.setFetchSize()

Any kind of help is appreciable.
Thanx
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sahina,

You probably need to setFetchSize() on your Statement first. By the time you've got your ResultSet, after the execute, to setFetchSize() on it, all the rows have already been retrieved. As I understand it setFetchSize() is available on ResultSet to allow you to change the fetch size after the initial execute.

Jules
 
please buy this thing and then I get a fat cut of the action:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic