File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Search Form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Search Form" Watch "Search Form" New topic
Author

Search Form

Prasad Babu
Ranch Hand

Joined: Jul 17, 2005
Posts: 57
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

Joined: Jul 19, 2005
Posts: 99
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!


We're doomed!!<br />Yay!!!<br />No that's bad Girr!!<br />Yay!!!
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
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.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Prasad Babu
Ranch Hand

Joined: Jul 17, 2005
Posts: 57
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

Joined: Mar 07, 2005
Posts: 232
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Search Form