This is a comprehensive, console-based banking application built in Java. It simulates the core functionalities of a banking system, including secure user/admin roles, financial transactions, and database logging.
This project connects to a MySQL database using JDBC and is built on a professional 3-Tier (Layered) Architecture to ensure clean, manageable, and scalable code.
- 3-Tier Architecture: Code is strictly separated into Presentation (UI), Business Logic (Services), and Data Access (DAO) layers.
- Dual User Roles:
- Customer Role: Can create an account, log in, deposit, withdraw, transfer, and view their transaction history.
- Admin Role: Can log in, view all user accounts, search for users, view system-wide statistics, and manage user accounts (freeze/unfreeze, delete, update).
- Security:
- Password Hashing: All user and admin passwords are hashed using SHA-256.
- Input Validation: User inputs for emails, phone numbers, and password strength are validated.
- Account Freezing: Admin can freeze and unfreeze user accounts.
- Database & Transactions:
- MySQL & JDBC: All account and transaction data is stored in a MySQL database.
- Transaction Logging: Every deposit, withdrawal, and transfer is recorded in a separate transactions table to generate a mini-statement.
- Language: Java (JDK 17+)
- Database: MySQL
- Connectivity: JDBC (via MySQL Connector/J)
- IDE: IntelliJ IDEA
-
Open MySQL Workbench (or any MySQL client).
-
Create a new database schema: sql CREATE DATABASE banking_simulator;
-
You do not need to create the tables. The Java application will do this automatically on its first run (in the initializeDatabase method).
-
Open the project in IntelliJ IDEA.
-
Navigate to org.example.BankSystemIntegrated.java.
-
Find this line (around line 19): java private static final String DB_PASS = "openssl rand -base64 18";
-
This is the most important step: Change "openssl rand -base64 18" to your actual MySQL password.
- Example: private static final String DB_PASS = "MyRootPassword123!";
- Download the MySQL Connector/J .jar file from the official MySQL website. (Select "Platform Independent" and get the ZIP archive).
- Unzip the file and find the .jar file.
- In IntelliJ, go to File
$\rightarrow$ Project Structure... - Select Libraries from the side menu.
- Click the + (plus) icon
$\rightarrow$ Java. - Find and select the mysql-connector-j-x.x.x.jar file you downloaded.
- Click OK on both windows.
- Open the BankSystemIntegrated.java file.
- Right-click in the file and select "Run 'BankSystemIntegrated.main()'".
- The application will start in your console, connect to the database, create the tables, and show the main menu.
The system automatically creates a default admin user for you.
- Username: admin
- Password: admin