JavaWorld
addict
Reged: 06/20/03
Posts: 482
|
|
Paging long lists
|
zvikico
Unregistered
|
|
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
|
Markus
Unregistered
|
|
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).
|
Anonymous
Unregistered
|
|
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
|