The Student Registration Web Application is a simple Java web application built using Java Servlets, JSP, JDBC, MySQL, and Apache Tomcat. It allows users to:
- Register students using a web form
- Store student data in a MySQL database
- View all registered students in a tabular format
This project demonstrates MVC architecture, database connectivity, and Java EE web development fundamentals.
- Java (JDK 17+ / JDK 25)
- Jakarta Servlet API
- JSP (JavaServer Pages)
- JDBC
- MySQL
- Apache Tomcat 10.1.x
- Maven
- Bootstrap 5 (Frontend styling)
StudentRegistrationApp
│
├── database
│ └── schema.sql
│
├── src
│ └── main
│ ├── java
│ │ ├── controller
│ │ │ ├── RegisterStudentServlet.java
│ │ │ └── ShowStudentsServlet.java
│ │ │
│ │ ├── dao
│ │ │ └── StudentDAO.java
│ │ │
│ │ ├── model
│ │ │ └── Student.java
│ │ │
│ │ └── util
│ │ └── DBConnection.java
│ │
│ └── webapp
│ ├── index.jsp
│ ├── students.jsp
│ └── WEB-INF
│ └── web.xml
│
├── pom.xml
└── README.md
- User inputs Name, Email, and Year
- Data is validated and stored in MySQL
- Displays all registered students in a table
- Clean and responsive UI using Bootstrap
You can create the database and table automatically using the provided schema script:
mysql -u root -p < database/schema.sql
When prompted, enter your MySQL root password.
Note: The schema script uses
CREATE TABLE IF NOT EXISTS, which creates the table if missing but does not alter or update an existing incompatible table definition.
Alternatively, you can run the SQL statements manually in your MySQL client:
CREATE DATABASE IF NOT EXISTS student_db;
USE student_db;
CREATE TABLE IF NOT EXISTS students (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
year INT NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Edit DBConnection.java to match your local MySQL configuration:
private static final String URL = "jdbc:mysql://localhost:3306/student_db";
private static final String USER = "root";
private static final String PASSWORD = "your_mysql_password";
- Java JDK
- Apache Maven
- MySQL Server
- Apache Tomcat 10.1.x
- IntelliJ IDEA (Recommended)
- File → Open → Select project folder
- Wait for Maven dependencies to download
-
Run → Edit Configurations
-
Add Tomcat Server (Local)
-
Deployment:
- Select StudentRegistrationApp: war exploded
-
Port:
8080
-
Start MySQL from:
- XAMPP / MySQL Installer / Services
-
Confirm MySQL is running
- Click Run ▶
- Open browser and visit:
http://localhost:8080/StudentRegistrationApp/
| Feature | URL |
|---|---|
| Student Registration | /index.jsp |
| View Students | /show_all |
- Open Registration Page
- Enter student details
- Click Register
- Click View All Students
- Data appears in the table
- Model:
Student.java - View:
index.jsp,students.jsp - Controller: Servlets
- DAO: Handles database operations
- Edit & delete students
- Search and filter
- Pagination
- Login system
- REST API version
Name: Petros Sisay
Course: Advanced Java Programming
Project Type: Academic
