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 Scrollable pages 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 "Scrollable pages" Watch "Scrollable pages" New topic

Scrollable pages

Per Lovdinger
Ranch Hand

Joined: Jun 11, 2001
Posts: 35
Scrollable pages
I have a jsp search page that I want to implement as scrollable.
There is a a search criteria on top and then there can be 20 lines of
found lines.
At the bottom there is a forward and a Next button ,in order to get next 20.
At the botton there is a text something like:
Lines 1 to 20 of 2000
My application Server is located in host_A and my dataBase is in host_B.
Assume that I want to read the database and populate the screen for first page.
That means I'm only interested in the first 20 rows and the total number of rows in the

Problem 1:
Since I'm only want the first 20 rows I don't want to move 2000 rows over the
net (performance), how can I prevent that ?
Is there any possibility in the sql ?
problem 2:
How can I find out the the total number of rows in the resultset without
reading through it ? There is no method in ResultSet...
I've tried the last() method but that seems equalily as slow.
Per Lovdinger

Daniel Dunleavy
Ranch Hand

Joined: Mar 13, 2001
Posts: 276
1. setFetchSize
It is sorta covered in the JavaRanch Style Guide.
subject: Scrollable pages
Similar Threads
Solving for Page With Slow Response Time
correct design of table GUI + large resultset
EJB-QL 2.0 & aggregate COUNT() functionality
oracle thin driver scrollable resultset.absolute(1) is not returing the first row