Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using of Statement.setFetchSize

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

While retrieving data from Oracle database facing problems. My query is returning nearly 500 records and while displaying it on the jsp page . Now if use stmt.setFetchSize(50)
how can i retreive the remaining rows??

 
Roger Bjärevall
DbVisualizer Support
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. setFetchSize() cannot be used to fetch increments. Check scrollable result sets in JDBC as this seem more appropriate in your case. Another solution is to fetch all 500 rows and let JSP code control what should be presented of the cached data.

Regards

Roger
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roger for your explanation.

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setFetchSize() is just less or more a performance setting. It determines how many rows to put in memory at once. It doesn't limit the total amount of rows to be returned. There you use the SQL LIMIT and/or OFFSET clauses for, depending on the DB used. Consult its SQL documentation for details.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke Scholtz wrote:The setFetchSize() is just less or more a performance setting. It determines how many rows to put in memory at once. It doesn't limit the total amount of rows to be returned. There you use the SQL LIMIT and/or OFFSET clauses for, depending on the DB used. Consult its SQL documentation for details.


Thanks .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic