This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Pagination Issue 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 "Pagination Issue" Watch "Pagination Issue" New topic
Author

Pagination Issue

kishore kovil
Greenhorn

Joined: Dec 21, 2006
Posts: 20
Hi,

Currently , I'm dealing with pagination .
I'm tryiing to do it by query.
but,i'm n't successful.
Pls. help me.

code:
______

My query is:
String query = "Select * from (Select a.*, rownum rnum From (select * from "
+ TableDetails
+ " order by rowid desc)a where rownum <= "
+ (recordsPerPage * (Integer.parseInt(pageNumber)))
+ ") where rnum >"
+ (recordsPerPage * ((Integer.parseInt(pageNumber) - 1)))
+ "";

with this query,
I'm not able to get all the results.
I'm missing some records.(say, missing 2 of 6)
I mean, this is working fine for Next button in jsp , but not for Previous button.

How can i modify the query?


Pls help me.


Thanks,
Kishore
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

Kishore,
First, try printing out the query. Are the indices what you expect?


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pagination Issue
 
It's not a secret anymore!