Enhanced Student Management System JDBC API Documentation
Enhanced Student Management System JDBC API Documentation
OF
ADVANCED JAVA PROGRAMMING (22517)
Science
2024-2025
Topic:
Student Management System Using JDBC API
Submitted by:-
1. Akshat Tiwari (56)
2. Tanishq Bhedarkar (35)
3. Abhay Chouhan (11)
4. Subhan Rathod (27)
HOD Name:-
Mrs.P.S Alur
1. Introduction
2. Components Used
3. Java Code
4. Java Code Executions
5. Graphical User Interface (GUI) Design
6. JDBC Database Connectivity
7. Database Setup
8. Conclusion
Introduction:
The Student Management System Using JDBC API is a Java-based desktop application
designed to facilitate managing student records in an educational institution. Built with
Java Swing for the GUI and JDBC for database interaction, it allows users to store and
manage details like Name, Aadhar, Contact, Address, Course, Remarks, and an optional
Image for each student.
The document provides in-depth explanations, guiding users through code structure,
database setup, user interface design, and the implementation of each feature.
Components Used:
• JFrame: The main window that holds all other components. It serves as the base
container for the application.
• JPanel: A panel to group UI components and manage layout. Panels can contain
components like text fields, labels, and buttons.
• JLabel: A display element for showing static text or images. Used here to label
fields and display images.
• JTextField: A single-line text input field for users to enter data. Used for name,
contact, Aadhar, address, and course inputs.
• JTextArea: A multi-line text input field, often used for remarks or longer
descriptions.
• JTable: A table component for displaying rows and columns of data. It's ideal for
showing the list of students and their attributes.
• ActionListener: An interface for handling action events, mainly for button clicks.
Each button in the GUI implements an ActionListener to define what happens
upon clicking.
• EventQueue: A queue that manages events and ensures GUI updates happen on
the Event Dispatch Thread, ensuring responsive GUI updates.
• ResultSet: A table of data representing the result of a query. It helps retrieve data
from SQL queries and iterate over each row.
4. File Handling
File handling is essential for uploading and displaying images associated with students in
this project.
• File: A class that represents a file in the file system. Used here to choose and set
the image path for student images.
6. Dialogs
Dialogs provide pop-up messages or user confirmations.
Java Code:
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import java.sql.*;
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.table.DefaultTableModel;
// JDBC credentials
private static final String DB_URL =
"jdbc:mysql://localhost:3306/student_management";
private static final String USER = "root";
private static final String PASSWORD = "Akshat";
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
try {
StudentManagementApp frame = new StudentManagementApp();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
});
}
public StudentManagementApp() {
setTitle("Student Management System");
setExtendedState(JFrame.MAXIMIZED_BOTH); // Full-screen mode
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
contentPane = new JPanel();
contentPane.setLayout(null); // Using null layout for absolute positioning
setContentPane(contentPane);
initializeComponents();
loadStudentData(); // Load student data on startup
}
// Aadhar Field
JLabel lblAadhar = new JLabel("Aadhar:");
lblAadhar.setBounds(30, 70, 120, 25);
contentPane.add(lblAadhar);
// Contact Field
JLabel lblContact = new JLabel("Contact:");
lblContact.setBounds(30, 110, 120, 25);
contentPane.add(lblContact);
// Address Field
JLabel lblAddress = new JLabel("Address:");
lblAddress.setBounds(30, 150, 120, 25);
contentPane.add(lblAddress);
// Course Field
JLabel lblCourse = new JLabel("Course:");
lblCourse.setBounds(30, 190, 120, 25);
contentPane.add(lblCourse);
// Remarks Field
JLabel lblRemark = new JLabel("Remarks:");
lblRemark.setBounds(30, 230, 120, 25);
contentPane.add(lblRemark);
// Image Upload
lblImage = new JLabel("No Image Selected");
lblImage.setBounds(150, 320, 200, 100);
lblImage.setBorder(BorderFactory.createLineBorder(Color.BLACK));
contentPane.add(lblImage);
1. Main Screen
The main screen of the Student Management System serves as the primary user interface,
displaying fields for student information input (like Name, Aadhar, Contact, Address,
Course, Remarks, and Image upload). It includes buttons for Submit, Edit, View All, and
Delete operations, which interact with the database to manage student records. A JTable
on this screen shows the list of students, and JOptionPane dialogs provide confirmation
messages and alerts
2. Data input screen
The Data Input Screen of the Student Management System serves as the primary
interface for entering and managing student information. This screen provides input fields
for capturing essential details such as Name, Aadhar, Contact, Address, Course,
Remarks, and an option to upload an Image.
Below the input fields are action buttons: Submit, Edit, View All, and Delete. These
buttons allow users to add new records, update existing ones, view all student entries, and
delete records as needed.
A JTable on the right side of the screen displays the student records, showing all
information in a structured format, which enables easy data management and quick
reference. JOptionPane dialogs are utilized to confirm actions and notify users, making
the system interactive and user-friendly.
3. File chooser screen
The File Chooser Screen in the Student Management System allows the user to select
an image file to associate with a student's profile.
In this screen:
• The File Chooser Dialog is open, showing folders and files from the user’s
system. It restricts the file type to display only image formats, such as .jpg, .jpeg,
and .png.
• The user can navigate through directories and choose an image, which will then
be linked to the student's record and displayed in the application.
• The Open button allows the user to confirm their file selection, while the Cancel
button closes the dialog without making any changes.
This screen enables users to easily select and upload images, improving the visual detail
and completeness of each student's profile in the system.
4. Submitted Data Screen
The Submitted Data Screen in the Student Management System shows the details of a student
that has been successfully added to the database.
In this screen:
• The left panel displays blank input fields for Name, Aadhar, Contact, Address, Course,
Remarks, and Image. These fields have been automatically cleared after submission,
ready for the next entry.
• The JTable on the right side lists the submitted student record with columns for ID,
Name, Aadhar, Contact, Address, Course, Remarks, and Image.
• The student record appears with a unique ID assigned, along with the details entered
during submission.
• The Image column displays the path of the uploaded image file associated with the
student.
This screen provides a clear view of the submitted data, enabling users to verify, edit, or delete
records as needed. The layout is designed for easy tracking of multiple student entries within the
system.
5. Data Deleting Screen
The Data Deleting Screen in the Student Management System allows users to remove a
student's record.
• Left Panel: Displays fields (Name, Aadhar, Contact, Address, Course, Remarks,
Image) for reviewing the selected student's details.
• Right Panel: Contains a JTable of all student records; users can select a student
by clicking a row.
• Delete Process: Clicking Delete prompts a confirmation dialog ("Are you sure
you want to delete this record?"). If confirmed, the record is removed from both
the display and the database, and the JTable refreshes.
This design emphasizes user confirmation, enhancing usability and data integrity.
Database Setup
The system uses a MySQL database named `student_management` to store student
details. Below is the SQL script to set up the database and table structure:
Each column stores specific student details, with `id` set as an auto-incrementing primary
key to ensure unique identification.
Conclusion
This Student Management System is an example of integrating Java and MySQL using
JDBC. By understanding how each component works, developers can expand on this
structure to create more complex systems or add additional features.