• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search Form

 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchians,

I have a scenario that i have data from the database i.e. in resultset. My intension is to display that data in tabular form just like Google search / yahoo search results. i think u understand the scenario. Please anybody have the solution or any sample code please help me.

its very urgent.

thanks in advance.
Prasad.
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just posting the solution is not going to help you in the long run, but I'll try and explain the methodology:

First you'll start by opening the table:


For each row in the resultset, you'll want at least one row in the table:


And then when there are no more rows, close the table:


Hope it helps!
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to say don't use scripting in JSP pages, use tags instead (JSTL, Struts). I'm also not sure about using resultset directly in JSP. Better will be use some dataobject.
 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bruin,
Thank you. Your approach is good for small amount of data like below 20-30 records. but what if the data is around more than 100 records? here i want to display the 10 records initially then next 10 when the user press / click the 'next' link / button. It is just like any search engine. If u go Google.com serach, initially 10-15 records only displayed then if we want next another we have to click 'next' link. this is my requirement. Actually today morning itself i came to know that we can achieve this by Value List Handler design pattern. i got one sample code from Oracle OTN site.
ok thanks for your reply. Have nice day.
yours friendly,
Prasad
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by prasad dandu:
Hi Bruin,
Thank you. Your approach is good for small amount of data like below 20-30 records. but what if the data is around more than 100 records? here i want to display the 10 records initially then next 10 when the user press / click the 'next' link / button. It is just like any search engine. If u go Google.com serach, initially 10-15 records only displayed then if we want next another we have to click 'next' link. this is my requirement. Actually today morning itself i came to know that we can achieve this by Value List Handler design pattern. i got one sample code from Oracle OTN site.
ok thanks for your reply. Have nice day.
yours friendly,
Prasad


Such an option is called "pagination". Search for pagination in google. readymade pagination components are developed by few vendors.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic