This is a Java EE web application that performs CRUD (Create, Read, Update, Delete) operations on a database table using JDBC, Servlets, and JSP. The application manages student records in a student_db database.
StudentManagementApp/
├── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── StudentManagementApp/
│ │ ├── Utils/
│ │ │ └── DatabaseUtil.java
│ │ ├── Servlets/
│ │ │ ├── CreateServlet.java
│ │ │ ├── ReadServlet.java
│ │ │ ├── UpdateServlet.java
│ │ │ └── DeleteServlet.java
│ │ └── Models/
│ │ └── Student.java
│ └── webapp/
│ ├── WEB-INF/
│ │ └── web.xml
│ ├── index.jsp
│ ├── add.jsp
│ ├── list.jsp
│ └── update.jsp
└── README.md
- Java Development Kit (JDK) 8 or higher
- Apache Tomcat 9.0 or higher
- MySQL database
- Create a database named student_db.
- Create a database named student_db.
Sql
CREATE TABLE students (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50),
email VARCHAR(50),
age INT
);
Update the database connection details in DatabaseUtil.java:
java
private static final String URL = "jdbc:mysql://localhost:3306/student_db";
private static final String USER = "your_username";
private static final String PASSWORD = "your_password";
- Clone the repository:
git clone https://github.com/yourusername/StudentManagementApp.git
-
Open the project in your IDE (Eclipse or IntelliJ IDEA).
-
Add the necessary JAR files for JDBC and Servlets to the project's build path.
-
Configure Tomcat in your IDE and deploy the project.
-
Access the application at http://localhost:8080/StudentManagementApp.
- Create: Add a new student record using the add.jsp form.
- Read: View the list of all students in the list.jsp page.
- Update: Update an existing student record using the update.jsp form.
- Delete: Delete a student record from the list in list.jsp.
- CreateServlet: Handles the creation of new student records.
- ReadServlet: Retrieves and displays the list of students.
- UpdateServlet: Handles the updating of existing student records.
- DeleteServlet: Handles the deletion of student records.
- index.jsp: Home page with links to the list of students and add student form.
- add.jsp: Form to add a new student.
- list.jsp: Displays the list of students with options to update or delete each record.
- update.jsp: Form to update an existing student's details.
- Ensure MySQL is running and the student_db database is created.
- Deploy the application on Tomcat.
- Navigate to http://localhost:8080/StudentManagementApp to access the application.
- Ensure the database connection details are correct in DatabaseUtil.java.
- Verify Tomcat is running on the specified port (default is 8080).
- Check the Tomcat logs for any errors during deployment.
Feel free to adjust any part of the description to better fit your project specifics or personal preferences.