• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to program page wise display?

 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
an example of what am asking can be found in main page of this jdbc topic..
that is if there are 200 rows i was to display 20 rows of data in each page.. how to do this..
this should be done dynamically ..i.e if the row changes to 230 the page should be increased along with the rows..
hope u guys got what is said..i tried out using session array?
need a code for this logic if there is any other logic than using session array..its urgent....
 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are probably as many opinions on how to do this as there are forum members. This is my way:
SELECT * FROM (
SELECT ROWNUM MORENUM, NUM, FOO FROM (
SELECT * FROM (
SELECT rownum num, FOO FROM BAR WHERE FOO LIKE( ? )
) ORDER BY NUM DESC
) ORDER BY FOO ASC
) WHERE num <= ? and num > ?;
The very first row contains the starting record number and how many rows in total there are, so when you are displaying a .jsp all the info is easy to get hold of.
Simon
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thaks simon,
well when u look at our home page for JDBC u can figure out the number of questions displayed,and the links ...
when u click the links say there are 20 questions displayed in a page,and click of the next link i.e "2" the next link is displayed..
how is this done......???
 
I AM MIGHTY! Especially when I hold this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic