It's not a secret anymore!
The moose likes JSP and the fly likes Database rows fetching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Database rows fetching" Watch "Database rows fetching" New topic

Database rows fetching

sitaram irrinki
Ranch Hand

Joined: Feb 16, 2005
Posts: 158
We are fetching data from DB using servlets and forwarding that data as o/p to the enduser in jsp page.if we r fetching 200 rows from the database,if it displays all the 200 rows at a time the perofrmance will be low .how can we display allthe rows at a time with out effecting the performance
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Search this forum with keywords "paging", "pagination", "LIMIT".
This gets asked (and answered) a lot here.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
vjy chin
Ranch Hand

Joined: Feb 17, 2005
Posts: 279
One way you can do is to get all the records and store in session, then display 10 records using pagination. So if the user clicks next, next 10 records will be displayed from the session (it does not need to go back to database). But if you dont want to use sessions, then I am not sure.

Experts can throw more light on this.
I agree. Here's the link:
subject: Database rows fetching
It's not a secret anymore!