File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Search Engine  through Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Search Engine  through Servlet" Watch "Search Engine  through Servlet" New topic

Search Engine through Servlet

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Can some help me making a search Engine by a Servlet ?
Our site has got 2 d/b. One is 'bout course details (it contains course name, code, duration ,fees , module details), and other is about placement details (it has fields like year, company, name, batch)
How can I handle this situation ? How I can search for Java+HTML-SQL.?
How can I search two tables ? ( the question comes if user wants to search for a particular course and another user wants to search how many students are placed in the year 1989 ? )
Angela Poynton
Ranch Hand

Joined: Mar 02, 2000
Posts: 3143
I think you might have a better chance of getting this answered in the Servlets and JSPs forum so I'm moving it there.

Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I think we need to know a little more about your problem. Are your two tables stored in a database? If so it is fairly straighforward to build a SQL query for any search you require, and execute that from your servlet using JDBC.
For example, to select all the details for a particular course, you might use SQL like:
select * from courses where name = 'Introduction to database programming'

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
NageswaraRao Karra
Ranch Hand

Joined: Nov 12, 2000
Posts: 34
Actually you should have explained more clearly.
Any how here is one of the possible answers.
from html page(the value of textfield for example) you get the value to the servlet by using getQueryString,getParameter etc..and pass this string to sql query if you are using jdbc so that it retrieves from tables.if the queryString contains
something like two or more words (java+jdbc etc...) through String manipulation you seperate them or do as per yr.need and write a sql query.
I agree. Here's the link:
subject: Search Engine through Servlet
It's not a secret anymore!