Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StudentRecordManager-Java

A console-based StudentRecordManager built with Java and MySQL, demonstrating Object-Oriented Programming (OOP) principles and database integration through JDBC.

Features

  • Add new student records
  • View all students
  • View a student by ID
  • Update existing student details
  • Delete a student record
  • Clean separation of concerns using DAO pattern (Model, DAO, DB connection, and UI layers)

Tech Stack

  • Language: Java (JDK 17+)
  • Database: MySQL
  • Connectivity: JDBC (MySQL Connector/J)

Project Structure

StudentManagementSystem/
├── src/
│   ├── Student.java         # Model class (student entity)
│   ├── DBConnection.java    # Handles MySQL connection
│   ├── StudentDAO.java      # CRUD operations (Data Access Object)
│   └── Main.java            # Console menu / entry point
├── schema.sql                # Database schema + sample data
├── README.md
└── .gitignore

Setup & Installation

1. Clone the repository

git clone https://github.com/<your-username>/StudentRecordManager.git
cd StudentRecordManager

2. Set up the database

Run the schema script in MySQL:

mysql -u root -p < schema.sql

3. Configure database credentials

Open src/DBConnection.java and update these fields to match your MySQL setup:

private static final String DB_URL = "jdbc:mysql://localhost:3306/student_db";
private static final String DB_USER = "root";
private static final String DB_PASSWORD = "your_password";

4. Download the MySQL JDBC driver

Download mysql-connector-j (a .jar file) from the official MySQL site and add it to your classpath.

5. Compile and run

# Compile
javac -d bin src/*.java

# Run (include the MySQL connector jar in the classpath)
java -cp "bin:mysql-connector-j-x.x.x.jar" Main

On Windows, replace the : in the classpath with ;:

java -cp "bin;mysql-connector-j-x.x.x.jar" Main

Sample Menu

=====================================
 StudentRecordManager
=====================================

----------- MENU -----------
1. Add Student
2. View All Students
3. View Student by ID
4. Update Student
5. Delete Student
6. Exit
-----------------------------
Enter your choice:

What I Learned

  • Implementing CRUD operations using JDBC and PreparedStatements (to prevent SQL injection)
  • Applying OOP concepts (encapsulation, separation of concerns) in a real project
  • Structuring a Java application using the DAO design pattern
  • Connecting a Java application to a MySQL database

About

Console-based Student Management System built with Java and MySQL, using JDBC and the DAO pattern to implement CRUD operations with core OOP principles.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages