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


Kudret Serin
Ranch Hand

Joined: Aug 02, 2005
Posts: 167

I have a table which has 100 rows. I want to show 20 rows per page. When the user clicks next, the next 20 records will be shown. How can i implement it? (MS SQL 2000 Server does not support LIMIT)
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

It looks like quite a few people have posted workarounds for this issue.

For small result sets, there is no reason that you couldn't create your own form paging in Java by writing all the rows to a list and only displaying the rows you like but I would make a serious attempt to limit the size of the results from the database first. A query that returns 50k rows could have a serious impact on your app.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Moving to JDBC where our MS-SQL Server gurus hang out.
I agree. Here's the link:
subject: Paging
It's not a secret anymore!