Problem Statement: Login Form Creation and Validation
using Servlet and MySQL
develop a Login System for a web application using Java Servlets and a MySQL database.
The system should authenticate users based on their credentials (username and password)
stored in the database.
Requirements
1. Login Page (HTML + CSS)
o Create a simple login form with the following fields:
Username (text box)
Password (password field)
Submit button ("Login")
o Provide proper form validation on the client side (e.g., fields should not be
empty).
2. Servlet for Processing Login
o When the user submits the form, the request should be sent to a LoginServlet.
o The servlet should retrieve the username and password from the request.
o It should then connect to a MySQL database to validate the credentials.
3. Database Setup (MySQL)
o Create a database UserDB with a table users.
o The users table should contain at least the following fields:
id (Primary Key, Auto Increment)
username (VARCHAR, unique)
password (VARCHAR)
o ----------------------
Problem Statement: Employee Information
Storage and Retrieval using Servlet and MySQL
You are required to design and implement a web application that allows users to store and
retrieve employee information using Java Servlets and a MySQL database.
Requirements
1. Employee Form (HTML Page)
o Create a web form to collect employee details:
Employee ID
Employee Name
Department
Salary
o Include two buttons:
Save → Store the employee data in the database.
Retrieve → Fetch employee data from the database using Employee
ID.
2. Servlet for Saving Employee Data
o On clicking Save, the form data should be submitted to a servlet
(SaveEmployeeServlet).
o The servlet should insert the data into the MySQL table employees.
o After saving, show a confirmation message:
“Employee record saved successfully!”
3. Servlet for Retrieving Employee Data
o On clicking Retrieve, the form should send the Employee ID to another
servlet (RetrieveEmployeeServlet).
o This servlet should query the database for the employee details using the given
Employee ID.
o If found, display the employee’s details in a structured format.
o If not found, display an error message:
“Employee not found!”
4. Database Setup (MySQL)
o Create a database CompanyDB with a table employees.