File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Paging-Query based Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Paging-Query based" Watch "Paging-Query based" New topic
Author

Paging-Query based

Atul Mishra
Ranch Hand

Joined: Jun 08, 2006
Posts: 140
All,

I have decided to implement query based paging for my huge report which can return large resultsets and now I need help with implementation.

In Oracle I learned about ROWNUM keyword. And I read articles about using ORDER BY DESC..

have anyone implemented this in Oracle ? If so, can you help ?

Thanks,
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I've used "select ... rownum() where rownum < nnn" in Oracle for this kind of thing. It's been years ... that's probably not exactly the right syntax. Today I had to learn "FETCH FIRST nnn ROWS ONLY" for DB2. ORDER BY might make the database engine fetch all rows and sort them before giving you the count you want so you may not save much.

Here are some notes from prior conversations about paging ...


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Paging-Query based