π 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.
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]
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
- 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
BankDAOandDataStoreleverage Java'stry-with-resourcesconstruct (try (CallableStatement cs = ...)), guaranteeing automatic release of database connections and statement handles. - SQL Injection Defenses: Transactions and updates utilize parametrized
CallableStatementstored procedure calls (CALL DepositMoney(?, ?)) and parametrizedPreparedStatementqueries.
- Java Development Kit (JDK 17 or higher)
- Apache Maven 3.8+
- MySQL Server 8.0+
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.pdfCopy .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"Compile the codebase and execute unit test suites using Maven:
# Clean, compile, and run JUnit 5 & Mockito test suites
mvn clean test# Launch the Swing GUI application
mvn exec:java -Dexec.mainClass="com.bank.Main"| Relational ER Diagram | Database SQL Views |
|---|---|
![]() |
![]() |
- 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.
Distributed under the MIT License. See LICENSE for details.
Author: Tahniat Farhan β BS Cyber Security, UET Lahore.

