Subject Name: Advanced Java
Subject Code: BCS613D
Name: Shodhan Kumar Shetty
USN: 4AL22CS143
Sem/Section: VI/C
A comprehensive web application for managing student examination marks built with JSP, Servlets, and MySQL following MVC architecture principles.
- Complete CRUD Operations: Add, Update, Delete, and Display student marks
- Advanced Search: Search student records by ID
- Comprehensive Reports: Generate various reports including:
- Students with marks above a specified threshold
- Students by subject
- Top N students based on marks
- Input Validation: Client-side and server-side validation
- Professional UI: Bootstrap-based responsive design
- MVC Architecture: Clean separation of concerns
- Database Integration: MySQL with JDBC connectivity
Before running this application, make sure you have the following installed:
- Java Development Kit (JDK) 8 or higher
- Apache Tomcat 9.0 or higher
- MySQL Server 5.7 or XAMP Server
- MySQL JDBC Driver (mysql-connector-java)
- IDE: Eclipse (J2EE), IntelliJ IDEA, or any Java IDE
- Web Browser: Chrome, Firefox, or Edge
MarkWebApp/
βββ src/
β βββ dao/
β β βββ MarkDAO.java
β βββ model/
β β βββ StudentMark.java
β βββ servlet/
β βββ AddMarkServlet.java
β βββ UpdateMarkServlet.java
β βββ DeleteMarkServlet.java
β βββ DisplayMarksServlet.java
β βββ ReportServlet.java
β βββ ReportCriteriaServlet.java
βββ WebContent/
β βββ index.jsp
β βββ markadd.jsp
β βββ markupdate.jsp
β βββ markdelete.jsp
β βββ markdisplay.jsp
β βββ reports.jsp
β βββ report_form.jsp
β βββ report_result.jsp
βββ WEB-INF/
β βββ web.xml
βββ README.md
sql
CREATE DATABASE IF NOT EXISTS mark_management;
USE mark_management;
### 2. Create Table
sql
CREATE TABLE IF NOT EXISTS StudentMarks (
StudentID INT PRIMARY KEY,
StudentName VARCHAR(100) NOT NULL,
Subject VARCHAR(50) NOT NULL,
Marks INT NOT NULL,
ExamDate DATE NOT NULL
);
sql
INSERT INTO StudentMarks VALUES
(1001, 'Sodhan', 'Mathematics', 85, '2025-04-10'),
(1002, 'Sumanth', 'Physics', 92, '2025-04-12'),
(1003, 'Suraj', 'Chemistry', 78, '2025-04-15'),
(1004, 'Shreyas', 'Biology', 89, '2025-04-10'),
(1005, 'Shashank', 'Computer Science', 95, '2025-04-18');
Download all the project files and organize them according to the project structure above.
- Start your MySQL server
- Run the database setup scripts provided above
- Update database credentials in MarkDAO.java:
java
connection = DriverManager.getConnection( "jdbc:mysql://localhost:3306/mark_management", "your_username", "your_password");
- Download MySQL Connector/J from the official MySQL website
- Add the JAR file to your project's WEB-INF/lib directory
- If using an IDE, add it to your build path
- Create a new Dynamic Web Project in your IDE
- Copy all source files to the appropriate folders
- Deploy the project to Tomcat server
- Start the Tomcat server
Open your web browser and navigate to:
http://localhost:8080/MarkWebApp/
- Navigate to "Add Marks" from the main menu
- Fill in all required fields:
- Student ID (unique identifier)
- Student Name (max 100 characters)
- Subject (select from dropdown)
- Marks (0-100)
- Exam Date (cannot be future date)
- Click "Add Student Mark"
- Go to "Update Marks"
- Search for a student by ID
- Modify the displayed information
- Click "Update Student Mark"
- Go to "Delete Marks"
- Search for a student by ID
- Confirm deletion by checking the confirmation box
- Click "Delete Student Record"
- Go to "Display Marks"
- Either view all records or search by specific Student ID
- Use the action buttons to Edit or Delete records
- Go to "Generate Reports"
- Select report type:
- Students Above Threshold: Enter minimum marks
- Students by Subject: Select subject
- Top Students: Enter number of top students
- Click "Generate Report"
- View results with statistics and print option
- Client-side: JavaScript validation with Bootstrap
- Server-side: Comprehensive validation in servlets
- Database constraints: Primary key and NOT NULL constraints
- Try-catch blocks for database operations
- User-friendly error messages
- Graceful handling of invalid inputs
- Prepared statements to prevent SQL injection
- Input validation
- Session management
- Bootstrap 5.3 framework
- Styling with hover effects
- Print-friendly report layouts
-
Add Operations:
- Add valid student records
- Try adding duplicate Student IDs (should fail)
- Test input validation (empty fields, invalid dates, etc.)
-
Update Operations:
- Update existing records
- Try updating non-existent Student ID
- Test field validation
-
Delete Operations:
- Delete existing records
- Try deleting non-existent Student ID
- Test confirmation mechanism
-
Display Operations:
- View all records
- Search by valid Student ID
- Search by invalid Student ID
-
Report Generation:
- Generate all three types of reports
- Test with different criteria values
- Verify statistics calculations
This project demonstrates:
- MVC Architecture: Clear separation between Model, View, and Controller
- Database Integration: CRUD operations with MySQL
- Web Development: JSP, Servlets, HTML, CSS, JavaScript
- Input Validation: Both client-side and server-side
- Report Generation: Dynamic data analysis and presentation
- Professional UI: Responsive design with Bootstrap











