Skip to content

Ratankumar27/Banking-System_JAVA-JDBC-MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

🏦 Banking Management System (Java + JDBC + MySQL)

A console-based Banking Application built in Java, using JDBC to connect with a MySQL database. It provides core banking functionalities such as account creation, secure login, debit/credit transactions, money transfer, and balance inquiry, with transaction safety and user privacy in mind.

🚀 Features

User Management

  • Register new users with name, email, and password.
  • Secure login with email and password authentication.
  • Prevents duplicate user registration.

Bank Account Management

  • Open new bank accounts with unique account numbers.
  • Initial deposit and security PIN setup.
  • One user can only hold one active account.

Transactions (ACID Compliant)

  • Debit Money – Withdraw funds with PIN verification.
  • Credit Money – Deposit securely into account.
  • Transfer Money – Atomic money transfer between accounts using transactions (commit / rollback).
  • Check Balance – PIN-protected balance inquiry.

Security & Privacy

  • Uses prepared statements to prevent SQL Injection.
  • Security PIN verification required for every transaction.
  • Passwords stored in DB (can be upgraded to hashing for production use).
  • Proper session-like flow: users must log in before performing actions.

Error Handling

  • Handles invalid inputs gracefully.
  • Prevents overdrafts (withdrawals > balance).
  • Ensures only valid accounts can transact.

⚙️ How It Works

  1. Run the application → Console menu appears.
  2. Register or Login:
    • Registration saves user data in the user table.
    • Login validates email & password.
  3. Open an Account (if not already created):
    • Provides unique account number.
    • Saves initial deposit and PIN in the accounts table.
  4. Perform Transactions:
    • Debit, Credit, Transfer, and Balance Check.
    • Uses connection.setAutoCommit(false) + commit() / rollback() to maintain transaction integrity.
    • Example: In transfer, if debit succeeds but credit fails → rollback ensures no half-completed transaction.
  5. Log Out / Exit safely.

🗄️ Database Schema

user Table

ColumnType
full_nameVARCHAR
emailVARCHAR (PK)
passwordVARCHAR

accounts Table

ColumnType
account_numBIGINT (PK)
full_nameVARCHAR
emailVARCHAR (FK)
balanceDOUBLE
security_pinVARCHAR

📌 Key Highlights

ACID Transactions → Transfer, Debit, Credit operations ensure atomicity & rollback safety.
Security First → PIN-based verification & SQL injection prevention using PreparedStatement.
Modular Design → Separated into BankingApp, User, Accounts, AccountsManager classes for clean OOP structure.
Scalability → Can be extended to support multiple accounts per user, interest calculation, statements, etc.
Industry Practices → JDBC, MySQL, exception handling, transaction management, data integrity enforcement.
Privacy-Oriented → User credentials & PIN verified before every sensitive operation.

🌟 What Makes This Project Unique

This project is not just a CRUD-based database app — it demonstrates real-world banking transaction handling with atomic operations, rollback safety, security measures, and a modular design. It reflects both practical coding skills and system-design thinking.

  • Database-driven applications
  • Security & privacy concerns in finance apps
  • Transaction management (a key skill in enterprise software)
  • Clean coding with OOP principles

🛠️ Tech Stack

  • Language: Java
  • Database: MySQL
  • Connectivity: JDBC (MySQL Connector/J)
  • Tools: IntelliJ IDEA / Eclipse

📂 Project Structure

Banking System/
 ├── src/
 │   ├── Accounts.java
 │   ├── AccountsManager.java
 │   ├── BankingApp.java
 │   ├── User.java
 ├── .classpath
 ├── .gitignore
 ├── .project
 └── README.md

▶️ How to Run

  1. Clone the repository and open it in your IDE (IntelliJ IDEA / Eclipse).
  2. Ensure MySQL server is running and update the database credentials in the code if required.
  3. Add the MySQL JDBC Driver (mysql-connector-j) to the project classpath.
  4. Compile and run the main class:
    src/BankingApp.java
    This class contains the main() method and starts the console-based Banking Application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages