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.
- Register new users with name, email, and password.
- Secure login with email and password authentication.
- Prevents duplicate user registration.
- Open new bank accounts with unique account numbers.
- Initial deposit and security PIN setup.
- One user can only hold one active account.
- 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.
- 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.
- Handles invalid inputs gracefully.
- Prevents overdrafts (withdrawals > balance).
- Ensures only valid accounts can transact.
- Run the application → Console menu appears.
- Register or Login:
- Registration saves user data in the
user
table. - Login validates email & password.
- Registration saves user data in the
- Open an Account (if not already created):
- Provides unique account number.
- Saves initial deposit and PIN in the
accounts
table.
- 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.
- Log Out / Exit safely.
Column | Type |
---|---|
full_name | VARCHAR |
VARCHAR (PK) | |
password | VARCHAR |
Column | Type |
---|---|
account_num | BIGINT (PK) |
full_name | VARCHAR |
VARCHAR (FK) | |
balance | DOUBLE |
security_pin | VARCHAR |
✅ ACID Transactions → Transfer, Debit, Credit operations ensure atomicity & rollback safety.
✅ Security First → PIN-based verification & SQL injection prevention using PreparedStatement.
✅ Modular Design → Separated into
✅ 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.
✅ 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.
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
- Language: Java
- Database: MySQL
- Connectivity: JDBC (MySQL Connector/J)
- Tools: IntelliJ IDEA / Eclipse
Banking System/ ├── src/ │ ├── Accounts.java │ ├── AccountsManager.java │ ├── BankingApp.java │ ├── User.java ├── .classpath ├── .gitignore ├── .project └── README.md
- Clone the repository and open it in your IDE (IntelliJ IDEA / Eclipse).
- Ensure MySQL server is running and update the database credentials in the code if required.
- Add the MySQL JDBC Driver (
mysql-connector-j
) to the project classpath. - Compile and run the main class:
src/BankingApp.java
This class contains themain()
method and starts the console-based Banking Application.