A comprehensive web-based Bank Management System built using Java, JDBC, Servlets, Spring Framework, JSP, and MySQL. This application provides complete banking operations with separate user and admin interfaces.
- Features
- Technology Stack
- Project Structure
- Database Schema
- Setup Instructions
- Default Login Credentials
- API Endpoints
- Screenshots
- Contributors
- β User Registration and Login
- β View Account Details (Balance, Transactions)
- β Create New Bank Accounts (Savings, Current, Fixed Deposit)
- β Deposit Money
- β Withdraw Money
- β Fund Transfer Between Accounts
- β View Transaction History
- β Update Profile
- β Change Password
- β View All Customers
- β View All Accounts with Balances
- β Approve/Deactivate User Accounts
- β Remove User Accounts
- β View and Manage All Transactions
- β Admin Dashboard with Statistics
| Technology | Purpose |
|---|---|
| Java 11+ | Core Programming Language |
| Spring Framework 5.3.30 | Dependency Injection & MVC |
| Spring JDBC Template | Database Operations |
| MySQL 8.0 | Database Management |
| JSP & JSTL | View Layer |
| Servlets | Request Handling |
| Maven | Build & Dependency Management |
| Apache Commons DBCP2 | Connection Pooling |
bank-management-system/
βββ src/
β βββ main/
β β βββ java/
β β β βββ com/
β β β βββ bank/
β β β βββ controller/
β β β β βββ UserController.java
β β β β βββ AccountController.java
β β β β βββ AdminController.java
β β β βββ dao/
β β β β βββ UserDAO.java
β β β β βββ UserDAOImpl.java
β β β β βββ AccountDAO.java
β β β β βββ AccountDAOImpl.java
β β β β βββ TransactionDAO.java
β β β β βββ TransactionDAOImpl.java
β β β βββ model/
β β β β βββ User.java
β β β β βββ Account.java
β β β β βββ Transaction.java
β β β βββ service/
β β β βββ UserService.java
β β β βββ UserServiceImpl.java
β β β βββ AccountService.java
β β β βββ AccountServiceImpl.java
β β β βββ TransactionService.java
β β β βββ TransactionServiceImpl.java
β β βββ resources/
β β β βββ database.properties
β β βββ webapp/
β β βββ WEB-INF/
β β βββ views/
β β β βββ login.jsp
β β β βββ register.jsp
β β β βββ dashboard.jsp
β β β βββ adminPanel.jsp
β β β βββ transactions.jsp
β β β βββ ...
β β βββ applicationContext.xml
β β βββ dispatcher-servlet.xml
β β βββ web.xml
βββ database/
β βββ bank_schema.sql
βββ pom.xml
| Column | Type | Description |
|---|---|---|
| user_id | INT (PK) | Auto-increment user ID |
| name | VARCHAR(100) | User's full name |
| VARCHAR(100) | Unique email address | |
| password | VARCHAR(255) | User password |
| role | ENUM | USER or ADMIN |
| created_at | TIMESTAMP | Registration timestamp |
| is_active | BOOLEAN | Account status |
| Column | Type | Description |
|---|---|---|
| account_id | INT (PK) | Auto-increment account ID |
| user_id | INT (FK) | Reference to users table |
| account_number | VARCHAR(20) | Unique account number |
| balance | DECIMAL(15,2) | Current balance |
| account_type | ENUM | SAVINGS, CURRENT, FIXED_DEPOSIT |
| created_at | TIMESTAMP | Account creation time |
| is_active | BOOLEAN | Account status |
| Column | Type | Description |
|---|---|---|
| transaction_id | INT (PK) | Auto-increment transaction ID |
| from_account | INT (FK) | Source account |
| to_account | INT (FK) | Destination account |
| amount | DECIMAL(15,2) | Transaction amount |
| type | ENUM | DEPOSIT, WITHDRAWAL, TRANSFER |
| description | VARCHAR(255) | Transaction description |
| date_time | TIMESTAMP | Transaction timestamp |
| status | ENUM | SUCCESS, FAILED, PENDING |
- Java 11 or higher
- Maven 3.6+
- MySQL 8.0+
- MySQL Workbench (for database management)
- Apache Tomcat 9.0+
cd "d:\Java\Bank Management System"
setup.batThis will automatically create the database, configure connection, test it, and build the project.
- Open MySQL Workbench
- Connect to your local MySQL instance
- Go to File β Open SQL Script
- Select:
database/bank_schema.sql - Click Execute (β‘ button)
OR run via command line:
mysql -u root -p < database/bank_schema.sqlπ Detailed Guide: See MYSQL_WORKBENCH_SETUP.md
In MySQL Workbench, run:
USE bank_management_db;
SELECT * FROM users; -- Should show 5 users
SELECT * FROM accounts; -- Should show 5 accounts
SELECT * FROM transactions; -- Should show 10 transactionsEdit src/main/resources/database.properties:
db.driver=com.mysql.cj.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/bank_management_db?useSSL=false&serverTimezone=UTC
db.username=root
db.password=YOUR_MYSQL_ROOT_PASSWORD # β Update this!mvn clean compile
mvn exec:java -Dexec.mainClass="com.bank.util.DatabaseConnectionTest"You should see: β ALL TESTS PASSED!
mvn clean install- Copy
target/bank-management-system.war - Paste to Tomcat's
webappsdirectory - Start Tomcat server
- Access:
http://localhost:8080/bank-management-system
- Quick Start: QUICK_START.md - 3-minute setup
- MySQL Workbench: MYSQL_WORKBENCH_SETUP.md - Step-by-step with screenshots
- Connection Details: DATABASE_CONNECTION_GUIDE.md - Troubleshooting
- Architecture: CONNECTION_ARCHITECTURE.md - Technical details
- Email: admin@bank.com
- Password: admin123
- Email: john.doe@email.com
- Password: user123
- jane.smith@email.com / user123
- robert.j@email.com / user123
- emily.d@email.com / user123
GET /login- Login pagePOST /login- Process loginGET /register- Registration pagePOST /register- Process registrationGET /logout- Logout
GET /user/dashboard- User dashboardGET /user/account/create- Create account formPOST /user/account/create- Process account creationGET /user/account/deposit- Deposit formPOST /user/account/deposit- Process depositGET /user/account/withdraw- Withdrawal formPOST /user/account/withdraw- Process withdrawalGET /user/account/transfer- Transfer formPOST /user/account/transfer- Process transferGET /user/transactions- View transaction historyGET /user/account/{accountId}- View account details
GET /admin/dashboard- Admin dashboardGET /admin/customers- View all customersGET /admin/accounts- View all accountsGET /admin/transactions- View all transactionsPOST /admin/user/approve/{userId}- Approve user accountPOST /admin/user/deactivate/{userId}- Deactivate userPOST /admin/user/delete/{userId}- Delete userGET /admin/user/{userId}- View user details
The application follows the MVC (Model-View-Controller) architecture:
- Model: Java POJOs representing database entities
- View: JSP pages for UI rendering
- Controller: Spring MVC Controllers for request handling
- DAO Layer: Data Access Objects for database operations
- Service Layer: Business logic implementation
Key Maven dependencies:
- Spring Framework (Core, Context, Web, MVC, JDBC)
- MySQL Connector
- Servlet API
- JSP & JSTL
- Apache Commons DBCP2
- SLF4J (Logging)
Configures:
- Spring ContextLoaderListener
- DispatcherServlet
- Character encoding filter
- Session timeout
- Error pages
Configures:
- Component scanning
- DataSource (Connection pool)
- JdbcTemplate
- Transaction manager
Configures:
- MVC annotation-driven
- View resolver
- Static resources
- Controller scanning
Spring Framework's IoC container manages all beans with @Autowired annotation.
@Transactional annotation ensures ACID properties for banking operations.
Apache Commons DBCP2 provides efficient database connection management.
- Session-based authentication
- Role-based access control (USER vs ADMIN)
- Input validation
Additional JSP pages need to be created:
deposit.jsp- Deposit money formwithdraw.jsp- Withdraw money formtransfer.jsp- Transfer money formtransactions.jsp- Transaction historyaccount-details.jsp- Account detail viewprofile.jsp- User profilechange-password.jsp- Change password formcreate-account.jsp- Create account formadmin-customers.jsp- All customers viewadmin-accounts.jsp- All accounts viewadmin-transactions.jsp- All transactions viewadmin-user-details.jsp- User detail view (admin)error.jsp- Error page
-
Database Connection Failed
- Verify MySQL is running
- Check database credentials in
database.properties - Ensure database exists
-
404 Error
- Verify Tomcat is running
- Check WAR deployment
- Verify context path
-
Compile Errors
- Run
mvn clean install - Check Java version (11+)
- Verify Maven dependencies
- Run
- Email notifications
- SMS alerts for transactions
- Password encryption (BCrypt)
- JWT-based authentication
- REST API implementation
- Mobile responsive design
- Transaction reports (PDF/Excel)
- Two-factor authentication
- Loan management module
- Credit card module
This project is created for educational purposes.
- Your Name - Initial work
For issues and queries, please create an issue in the repository.
Note: Remember to change default passwords and implement proper security measures before deploying to production!