• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to program page wise display?

 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • 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....
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • 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
  • 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......???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic