File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Scrollable pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
I agree. Here's the link:
subject: Scrollable pages
It's not a secret anymore!