Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 959182

Pages: 1
JavaWorld
addict


Reged: 06/20/03
Posts: 482
Paging long lists
      #9670 - 07/25/04 01:41 PM

Paging long lists

Post Extras: Print Post   Remind Me!   Notify Moderator  
zvikico
Unregistered




Re: Paging long lists [Re: JavaWorld]
      #9673 - 07/25/04 02:16 PM

The query you wrote for Oracle will never work. The rownum is calculated while the query is executing so something like "select ... where rownum > 5" will never yield any result - the first row will not match, then the second row will be the first row, which will not match and so on.

You have sevral options -
1. Use nested quries - run the first query, capture the rownum as a field in the result set and query on that field as you would on any field.
2. Use java cursor that can jump to the first row you need.
3. Keep cursor open for each query.

None of these is a good solution - although I've found the second solution minimizes the damage. If you have any better - do share.

Zviki zvikico@netvision.net.il


Post Extras: Print Post   Remind Me!   Notify Moderator  
Markus
Unregistered




Re: Paging long lists [Re: JavaWorld]
      #9686 - 07/26/04 05:03 AM

How does this tag lib differ from the old pager taglib ( http://jsptags.com/tags/navigation/pager/pager-taglib-2.0.html ) ? It seems like this taglib has support for lazy fetch which AFAIK pager taglib does not have. In pager taglib I think you have to have the full collection you're showing available from the start (or be smart and populate the items that are not showing with null).

Post Extras: Print Post   Remind Me!   Notify Moderator  
Anonymous
Unregistered




Re: Paging long lists [Re: zvikico]
      #25166 - 12/21/05 05:19 AM

Hi
I saw ur reply and I found that you are using
select ... where rownum > 5 and its failing so instead you create a view in which order you want the data and than access the view instead of table in the query that should solve your problem.
For eg "SELECT .....FROM table_view WHERE rownum <= 5

Regards
Sunil Barge
sunil_barge@dss.co.in


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 8016

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5