A Java-based JDBC Database Application that demonstrates database connectivity and CRUD operations using JDBC API with MySQL and Oracle databases.
This project demonstrates how Java applications communicate with relational databases using JDBC (Java Database Connectivity) and perform database operations such as creating tables, inserting records, updating records, deleting records, searching records, and displaying data.
JDBCAPP is a console-based database application developed using Java JDBC technology.
The main objective of this project is to understand:
- JDBC Architecture
- Database Connectivity
- SQL Integration with Java
- PreparedStatement Usage
- ResultSet Handling
- CRUD Operations
- Real-Time Database Application Development
The application supports:
- MySQL Database Connectivity
- Oracle Database Connectivity
- Database SQL Scripts
- Table Creation
- Sample Data Insertion
- Employee Record Management
- Connect Java applications with MySQL Database
- Connect Java applications with Oracle Database
- Manage database connections using JDBC API
- Handle database exceptions
The application supports complete CRUD operations:
- Create database tables
- Execute SQL CREATE queries
- Retrieve employee records
- Display database information
- Modify existing employee details
- Remove employee records from database
- Java
- MySQL
- Oracle Database
- JDBC (Java Database Connectivity)
- Visual Studio Code
- MySQL Workbench
- Oracle Database Express Edition
- MySQL Connector/J
Java Application
|
|
↓
JDBC API
|
|
↓
JDBC Driver
|
|
↓
Database
(MySQL / Oracle)
JDBCAPP-Database-Application
│
├── README.md
├── LICENSE
├── .gitignore
│
├── database
│ │
│ ├── mysql
│ │ ├── create_database.sql
│ │ ├── create_table.sql
│ │ └── sample_data.sql
│ │
│ └── oracle
│ ├── create_database.sql
│ ├── create_table.sql
│ └── sample_data.sql
│
└── JDBCAPP
│
├── README.md
│
├── lib
│ └── mysql-connector-j.jar
│
└── src
│
└── com.jdbcapp
│
├── main
│ └── JDBCAPP.java
│
├── mysql
│ └── MySQLApp.java
│
├── oracle
│ └── OracleApp.java
│
└── util
└── DBConnection.java
Execute SQL files in the following order:
File:
database/mysql/create_database.sql
Creates:
jdbcapp
File:
database/mysql/create_table.sql
Creates:
Employee
Table Structure:
| Column | Data Type |
|---|---|
| emp_id | INT |
| emp_name | VARCHAR |
| emp_salary | DOUBLE |
| emp_department | VARCHAR |
File:
database/mysql/sample_data.sql
Inserts employee records into the Employee table.
Execute SQL files in the following order:
database/oracle/create_database.sql
database/oracle/create_table.sql
database/oracle/sample_data.sql
Database connection handling is implemented in:
src/com/jdbcapp/util/DBConnection.java
Responsibilities:
- Load JDBC Driver
- Establish database connection
- Manage MySQL connection
- Manage Oracle connection
- Close database connections
Location:
com.jdbcapp.main
File:
JDBCAPP.java
Responsibilities:
- Display main application menu
- Select database option
- Start MySQL or Oracle application
Location:
com.jdbcapp.mysql
File:
MySQLApp.java
Responsibilities:
- Connect with MySQL Database
- Perform CRUD operations
- Manage Employee records
Location:
com.jdbcapp.oracle
File:
OracleApp.java
Responsibilities:
- Connect with Oracle Database
- Perform CRUD operations
- Manage Employee records
Add MySQL Connector JAR:
JDBCAPP/lib/mysql-connector-j.jar
Navigate to:
JDBCAPP/src
Execute:
javac -cp "..\lib\mysql-connector-j.jar" com\jdbcapp\util\DBConnection.java com\jdbcapp\mysql\MySQLApp.java com\jdbcapp\oracle\OracleApp.java com\jdbcapp\main\JDBCAPP.javaExecute:
java -cp ".;..\lib\mysql-connector-j.jar" com.jdbcapp.main.JDBCAPP==========================================
JDBCAPP - Database Application
==========================================
1. MySQL
2. Oracle
3. Exit
==========================================
========== MySQL Database Menu ==========
1. Create Table
2. Insert Record
3. Update Record
4. Delete Record
5. Search Record
6. Display Records
7. Exit
==========================================
MySQL Database Connected Successfully.
101 | Rahul | 45000.00 | HR
102 | Priya | 52000.00 | Finance
103 | Arjun | 60000.00 | Development
104 | Sneha | 48000.00 | Testing
105 | Kiran | 55000.00 | Support
Example:
ID: 106
Name: Basha
Salary: 70000
Department: Java
Output:
Inserted.
Output:
106 | Basha | 70000.00 | Java
Output:
Updated.
Output:
Deleted.
Output:
Employee Record Found
This project covers:
- Java Database Connectivity
- JDBC API
- JDBC Driver Management
- SQL Integration
- PreparedStatement
- Statement
- ResultSet
- Exception Handling
- Database Transactions
- CRUD Application Development
JDBC concepts learned from this project are used in:
- Banking Applications
- Employee Management Systems
- Inventory Applications
- Student Management Systems
- Enterprise Java Applications
Possible improvements:
- Add GUI using Java Swing/JavaFX
- Add Spring JDBC Integration
- Add Hibernate ORM
- Add User Authentication
- Add Connection Pooling
- Convert into Web Application
If this repository helps you in your learning journey, interview preparation, or future reference, please consider giving it a Star ⭐. Your support is greatly appreciated and motivates me to continue creating high-quality educational repositories.
JDBCAPP - Database Application provides practical knowledge of connecting Java applications with relational databases using JDBC.
This project demonstrates complete database interaction using Java and prepares the foundation for developing enterprise-level database applications.
Happy Learning and Keep Coding!