Skip to content

Latest commit

Β 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Banking Management System (Java Swing / JDBC / MySQL)

Java CI with Maven CodeQL Analysis License: MIT Java 17 Build System: Maven

πŸŽ“ Academic Project Disclaimer: This repository is an educational laboratory demonstration project developed for the Database Systems / Object-Oriented Programming course in the BS Cyber Security degree program at UET Lahore. It demonstrates 3-Tier Architecture, JDBC connection management, Data Access Object (DAO) pattern, and Java Swing GUI components.


πŸ“ System Architecture

The application adopts a 3-Tier Data Access Object (DAO) pattern separating UI presentation, domain models, data access objects, and relational database persistence:

graph TD
    A[Swing Desktop GUI / CLI Client] -->|Invokes Data Operations| B[BankDAO / DataStore Layer]
    B -->|Establishes Secure JDBC Session| C[DBConnection Config]
    C -->|Environment-Configured Credentials| D[(MySQL Relational Database)]
    D -->|Executes Stored Procedures| E[DepositMoney / WithdrawMoney Procedures]
Loading

πŸ“ Project Structure

bank-management-system-java/
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ dependabot.yml              # Automated monthly dependency scanner
β”‚   └── workflows/
β”‚       β”œβ”€β”€ ci.yml                  # Maven Build & JUnit 5 test runner
β”‚       └── codeql.yml              # CodeQL Static Application Security Testing
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ diagrams/
β”‚   β”‚   └── ERD.png                 # Relational Database ER Diagram
β”‚   └── screenshots/
β”‚       β”œβ”€β”€ Output SQL.png          # Database Stored Procedure Execution
β”‚       └── Views.png               # SQL Database Views Output
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ Bank Management System Lab Report.pdf
β”‚   └── sql.mwb                     # MySQL Workbench Model File
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/java/com/bank/
β”‚   β”‚   β”œβ”€β”€ dao/
β”‚   β”‚   β”‚   β”œβ”€β”€ BankDAO.java        # Stored Procedure Data Access Object
β”‚   β”‚   β”‚   β”œβ”€β”€ DBConnection.java   # Portable Environment JDBC Provider
β”‚   β”‚   β”‚   └── DataStore.java      # Relational Data Loader
β”‚   β”‚   β”œβ”€β”€ gui/
β”‚   β”‚   β”‚   └── BankGUI.java        # Java Swing User Interface
β”‚   β”‚   β”œβ”€β”€ model/
β”‚   β”‚   β”‚   β”œβ”€β”€ Account.java        # Account Entity Model
β”‚   β”‚   β”‚   β”œβ”€β”€ Bank.java           # Bank Aggregate Container
β”‚   β”‚   β”‚   β”œβ”€β”€ Customer.java       # Customer Entity Model
β”‚   β”‚   β”‚   └── Person.java         # Base Person Abstract Class
β”‚   β”‚   β”œβ”€β”€ util/
β”‚   β”‚   β”‚   └── FeedbackStore.java  # Feedback file logging utility
β”‚   β”‚   β”œβ”€β”€ Client.java             # Terminal Client Entry Point
β”‚   β”‚   └── Main.java               # Swing GUI Application Entry Point
β”‚   └── test/java/com/bank/
β”‚       β”œβ”€β”€ dao/
β”‚       β”‚   └── BankDAOTest.java    # Mockito DAO Unit Tests
β”‚       └── model/
β”‚           └── BankTest.java       # JUnit 5 Domain Model Tests
β”œβ”€β”€ .env.example                    # Environment variable configuration template
β”œβ”€β”€ .gitignore                      # Git exclusion rules
β”œβ”€β”€ CODE_OF_CONDUCT.md              # Contributor Covenant Code of Conduct
β”œβ”€β”€ CONTRIBUTING.md                 # Contribution guidelines
β”œβ”€β”€ LICENSE                         # MIT License
β”œβ”€β”€ pom.xml                         # Apache Maven build & dependency manifest
β”œβ”€β”€ README.md                       # Comprehensive Project Documentation
└── SECURITY.md                     # Vulnerability reporting security policy

πŸ›‘οΈ Security Notes & Best Practices

  • Zero Hardcoded Credentials: Database parameters are dynamically parsed from environment variables (DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD), eliminating security credential leaks.
  • Strict JDBC Resource Management: All database operations inside BankDAO and DataStore leverage Java's try-with-resources construct (try (CallableStatement cs = ...)), guaranteeing automatic release of database connections and statement handles.
  • SQL Injection Defenses: Transactions and updates utilize parametrized CallableStatement stored procedure calls (CALL DepositMoney(?, ?)) and parametrized PreparedStatement queries.

πŸ› οΈ Installation & Execution

Prerequisites

  • Java Development Kit (JDK 17 or higher)
  • Apache Maven 3.8+
  • MySQL Server 8.0+

1. Database Setup

Execute the relational schema and stored procedures inside MySQL Workbench using docs/sql.mwb or run the database DDL script:

CREATE DATABASE bank_db;
USE bank_db;

-- Execute table creations and procedures defined in docs/Bank Management System Lab Report.pdf

2. Environment Configuration

Copy .env.example to create your local configuration or export system environment variables:

export DB_HOST="localhost"
export DB_PORT="3306"
export DB_NAME="bank_db"
export DB_USER="root"
export DB_PASSWORD="your_secure_mysql_password"

3. Build & Test

Compile the codebase and execute unit test suites using Maven:

# Clean, compile, and run JUnit 5 & Mockito test suites
mvn clean test

4. Run Application

# Launch the Swing GUI application
mvn exec:java -Dexec.mainClass="com.bank.Main"

πŸ“Έ Screenshots & ER Diagram

Relational ER Diagram Database SQL Views
ER Diagram SQL Views

πŸš€ Future Improvements

  • Implement HikariCP database connection pooling.
  • Add BCrypt password hashing for customer portal authentication.
  • Integrate H2 in-memory database profile for automated integration testing without requiring a live local MySQL server.

πŸ“„ License & Author

Distributed under the MIT License. See LICENSE for details.

Author: Tahniat Farhan β€” BS Cyber Security, UET Lahore.

About

Desktop Banking Management System built with Java Swing GUI, JDBC, DAO pattern, and MySQL relational database.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages