This is a simple Banking App developed in Java that allows users to perform basic bank account management operations via a console interface. It connects to a MySQL database to persist account data.
- β Add new bank accounts
- π View details of a specific account
- βοΈ Update account information
- β Delete an account
- π View all accounts stored in the database
BankMain.javaβ Main class with the interactive console menu and user input handling.model.Accountβ Java class representing the bank account entity.service.Serviceβ Handles database connection and CRUD operations using JDBC.
+------------------+ +-----------------+ +------------------+
| BankMain.java | -----> | Service.java | -----> | MySQL DB |
| (User Interface) | | (DB Operations) | | (bank table) |
+------------------+ +-----------------+ +------------------+
| ^
| |
v |
+------------------+ |
| Account.java |----------------+
| (Account Model) |
+------------------+
Explanation:
BankMain.javahandles user interaction via console menus.- It calls methods from
Service.javato perform CRUD operations. Service.javaconnects to the MySQL database to store/retrieve account data.Account.javarepresents the data structure for a bank account.
- β Java SE
- π JDBC for database connectivity
- π¬ MySQL database
- π₯οΈ Console-based user interface
- β Java Development Kit (JDK) installed
- π¬ MySQL Server installed and running
- π¦ MySQL Connector/J (JDBC driver) added to your project dependencies
Important: Add the MySQL Connector/J.jarfile to your project build path to enable database connectivity - ποΈ A database created with the following table:
CREATE DATABASE DBName;
USE DBName;
CREATE TABLE bank (
acc_number VARCHAR(20) PRIMARY KEY,
cust_name VARCHAR(100) NOT NULL,
balance DOUBLE NOT NULL
);git clone https://github.com/yourusername/banking-app.git
cd banking-app
Open the service.Service class and update the following variables with your MySQL credentials and database name:
String url = "jdbc:mysql://localhost:3306/DBName";
String user = "your_userName";
String password = "your_mysql_password";Make sure the MySQL Connector/J .jar file is included in your projectβs build path.
javac -d bin src/**/*.java
java -cp "bin;path_to_mysql_connector.jar" main.BankMainNote: Replace path_to_mysql_connector.jar with the actual path to your MySQL Connector/J jar file.
Run the application.
You will see a menu with options to:
- Add bank accounts
- View bank accounts
- Update bank accounts
- Delete bank accounts
- List all bank accounts
Input your choice as a number and follow the prompts.
The app performs requested operations directly on the MySQL database.
To exit, choose option 6.
- Add transaction management (deposit/withdraw)
- Implement input validations and exception handling
- Add a graphical user interface (GUI)
- Support multiple users with authentication
Shruti Parikshit Sangvikar
3rd Year Engineering Student