• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Search Form

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you're gonna buy things, buy this thing and I get a fat kickback:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic