This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Paging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Paging" Watch "Paging" New topic
Author

Paging

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
Sheriff

Joined: Dec 11, 2004
Posts: 13410

It looks like quite a few people have posted workarounds for this issue.
http://www.google.com/search?hl=en&q=SQL-SERVER+paging+limit&btnG=Google+Search

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
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Moving to JDBC where our MS-SQL Server gurus hang out.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Paging