COP 4610L (Spring 2004)
Operating Systems Lab (Distributed Applications in the Enterprise)
Dr. R. Lent

Programming Assignment 4

DUE: Monday, March 22, 8:00 PM

In this project, we will use the database created in the previous assignment to implement a web search engine.

Consult the previous assignment for details on the format of the database (name, tables, user, password). A premade database is provided (in case you did not finished the previous assignment). To install this database, extract the files from cop4610webs.tar into c:\mysql\data

Steps to complete:

0. Install and get familiar with Tomcat (you will need to define the environment variable TOMCAT_HOME pointing to the base directory of this program)

1. Study the web page provided (index.html). The page receives input from the user and invokes the servlet that you are to implement. The user should specify one or more keywords to search, select the searching mode (Any/All/Exact), and the desired number of results (5, 10 or all results).

2. Implement a servlet that operates in the following way:

a. (20 pt) Loads the JDBC driver and establishes a connection with database "cop4610webs" (user: webs, password: abc123). These actions should take place in the "init" method.

b. (20 pt) When a new client invokes the servlet (service method), it retrieves the requested parameters from the web page (keyword(s), mode of search, and number of results).

c. (20 pt) If no keyword is entered, the servlet redisplays the welcome page (index.html).

d. (20 pt) Creates and executes an appropriate query to database "cop4610webs" to retrieve the desired information. You will have to create appropriate queries for each of the Any/All/Exact searching modes.

e. (20 pt) Displays the desired number of results. If no results are found, then you must display a message saying "No results found". Note that you can limit the number of results with SQL.

f. E.C. (10pt): Add case sensitivity/no sensitivity to the search engine (an on/off button for this option is already in index.html).

Software

JDK 1.4.x, an IDE

MySQL

JDBC driver for MySQL (copy mysql-connector-java-3.0.8-stable-bin.jar to your %JAVA_HOME%/jre/lib/ext directory)

Tomcat

Instructions and comments

1. Insert appropriate comments to facilitate the grading of your work. You may attach an extra text file explaining your program.

2. Pack (zip, rar, tar) your source files and submit your assignment before the due time/date via WebCT