Skip to content

About

Java JDBC Mini Project using MySQL for performing CRUD operations. Includes database connectivity, secure queries with PreparedStatement, and modular project structure. Built for learning and academic purposes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JDBC Project

This is a Java-based JDBC project that demonstrates how to connect a Java application with a MySQL database and perform basic database operations such as Insert, Update, Delete, and Fetch records.


📌 Features

  • Connects Java application to MySQL using JDBC
  • Perform CRUD operations (Create, Read, Update, Delete)
  • Uses PreparedStatement for secure queries
  • Modular project structure
  • Easy to understand for beginners

🛠️ Technologies Used

  • Java (JDK 8 or above)
  • MySQL Database
  • JDBC Driver (MySQL Connector)
  • Visual Studio Code / Eclipse

📁 Project Structure


JDBC_PROJECT/
│
├── src/
│   └── util/
│       └── DBConnection.java
│
├── lib/
│   └── mysql-connector-j.jar
│
├── bin/
│
└── README.md


⚙️ Setup Instructions

1️⃣ Install Requirements

Make sure you have:

  • Java JDK installed
  • MySQL installed
  • MySQL Connector JAR file

2️⃣ Configure Database

Create a database in MySQL:

CREATE DATABASE jdbc_project;
USE jdbc_project;

Create a table:

CREATE TABLE users (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(50),
    email VARCHAR(50)
);

3️⃣ Update Database Credentials

Open:

src/util/DBConnection.java

Update:

String url = "jdbc:mysql://localhost:3306/jdbc_project";
String user = "root";
String password = "your_password";

4️⃣ Add JDBC Driver

Make sure mysql-connector-j.jar is added inside:

lib/

And included in your classpath.


5️⃣ Run the Project

Compile:

javac -cp ".;lib/*" src/**/*.java

Run:

java -cp ".;lib/*;bin" MainClassName

(Replace MainClassName with your main file name)


🚀 How It Works

  1. Program connects to MySQL using JDBC
  2. Executes SQL queries
  3. Fetches and displays data
  4. Updates database records
  5. Handles errors using try-catch

📸 Sample Output

Connected to Database Successfully!
Data Inserted
Data Retrieved
Program Finished

❗ Common Errors

❌ Driver Not Found

  • Check if JAR is added properly

❌ Access Denied

  • Verify username/password

❌ Connection Failed

  • Check if MySQL service is running

👨‍💻 Author

Name: Pranav Ganorkar Course: Information Technology Project: JDBC Mini Project


📄 License

This project is for educational purposes only.

About

Java JDBC Mini Project using MySQL for performing CRUD operations. Includes database connectivity, secure queries with PreparedStatement, and modular project structure. Built for learning and academic purposes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages