A layered banking application demonstrating Java web development, JDBC database access, Servlet request handling, JSP/JSTL, business-layer separation, custom exception handling, Maven build management, and WAR deployment.
- About
- Features
- Architecture
- Project Demonstration
- Technologies Used
- Java and Backend Concepts
- Request Flow
- Project Structure
- Database
- Maven Build and WAR Packaging
- Getting Started
- How to Use
- Error Handling
- Future Enhancements
- Learning Outcomes
- Author
The Advance Java Web Banking Application is a server-side Java web application that simulates common banking operations through a browser-based interface.
The application builds on core Java and JDBC concepts and applies them to a complete web application using:
Java β JDBC β MySQL β Maven β Jakarta Servlets β JSP/JSTL β Layered Architecture β WAR β Apache Tomcat
The application supports:
- π¦ Opening a bank account
- π° Depositing money
- πΈ Withdrawing money
- π Transferring money between accounts
- π Viewing account statements
- π Searching accounts
- π Listing accounts
β οΈ Handling business and HTTP errors through dedicated error pages
The main focus of the project is understanding how a Java web application's presentation, request handling, business logic, database access, exception handling, build process, and deployment work together.
Create a new customer account by providing:
- Customer name
- Account type
- Initial deposit
Deposit money into an existing account.
Withdraw money after validating the account and available balance.
Transfer money from one account to another.
The operation validates:
- Sender account
- Receiver account
- Transfer amount
- Sender's available balance
Search an account and view its transaction history.
The application provides operations for:
- Searching for a specific account
- Listing available accounts
The application provides dedicated error pages for important application and business failures.
Examples include:
- Account not found
- Insufficient balance
- Validation errors
- Database errors
- HTTP 404 β Page Not Found
- HTTP 500 β Internal Server Error
The application follows a layered architecture that separates HTTP handling, business logic, database operations, and presentation.
USER / BROWSER
β
β HTTP Request
βΌ
βββββββββββββββββββββββ
β JSP Pages β
β HTML + JSTL + CSS β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Servlets β
β Request Handling β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β BankService β
β Business Logic β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Repository β
β JDBC / SQL β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β MySQL β
β Database β
βββββββββββββββββββββββ
| Layer | Responsibility |
|---|---|
| JSP | Presentation and user interface |
| Servlet | HTTP request/response handling |
| Service | Banking and business rules |
| Repository | Database operations and SQL |
| Domain | Application data and entities |
| Exceptions | Application-specific failure handling |
| MySQL | Persistent data storage |
This separation keeps the application modular and makes individual layers easier to understand, maintain, and extend.
The repository contains GIF demonstrations of the main application workflows.
| Technology | Purpose |
|---|---|
| Java 25 | Core application development |
| JDBC | Database connectivity |
| MySQL | Persistent data storage |
| Jakarta Servlets | HTTP request and response handling |
| JSP | Server-side presentation |
| JSTL | JSP presentation logic |
| HTML/CSS | Web interface |
| Maven | Dependency and build management |
| Apache Tomcat | Servlet container and deployment |
| Git | Version control |
| GitHub | Repository hosting |
This project demonstrates practical application of several Java and backend development concepts.
- Object-Oriented Programming
- Encapsulation
- Abstraction
- Interfaces
- Enums
- Classes and objects
- Exception handling
- Custom exceptions
- JDBC
- SQL
- PreparedStatement
- ResultSet
- CRUD operations
- Database connectivity
- Layered architecture
- Repository pattern
- Service layer
- Separation of concerns
- DTO usage
- Domain models
- Validation
- HTTP request/response handling
- Servlets
- JSP
- JSTL
web.xml- Error-page configuration
- WAR packaging
- Servlet-container deployment
- Maven dependencies
- Maven lifecycle
- Maven packaging
- Git and GitHub
A typical request travels through the application as follows:
Browser
β
β HTTP Request
βΌ
Servlet
β
βΌ
Service
β
βΌ
Repository
β
βΌ
MySQL
β
βΌ
Repository
β
βΌ
Service
β
βΌ
Servlet
β
βΌ
JSP
β
βΌ
Browser
Withdraw.jsp
β
βΌ
WithdrawServlet
β
βΌ
BankService
β
βββ Validate account
βββ Validate amount
βββ Validate balance
β
βΌ
AccountRepository
β
βΌ
MySQL
β
βΌ
TransactionRepository
β
βΌ
Success / Error JSP
This request flow demonstrates how a browser request is processed through different backend layers rather than placing all application logic inside a Servlet or JSP.
advancejavabankingapp/
β
βββ pom.xml
βββ README.md
βββ LICENSE
βββ .gitignore
β
βββ README-assets/
β βββ banner.png
β βββ gifs/
β βββ OpenAccount.gif
β βββ Deposit.gif
β βββ Withdraw.gif
β βββ Transfer.gif
β βββ AccountStatement.gif
β βββ ListAccountsAndSearchAccount.gif
β βββ AccountNotFoundAndInsufficientAmount.gif
β
βββ src/
βββ main/
βββ java/
β βββ config/
β β βββ ApplicationContextListener.java
β β
β βββ controller/
β β βββ main/
β β β βββ Main.java
β β βββ AccountDTO.java
β β βββ AccountStatementServlet.java
β β βββ DepositServlet.java
β β βββ ListAccountsServlet.java
β β βββ OpenAccountServlet.java
β β βββ SearchAccountServlet.java
β β βββ TransferServlet.java
β β βββ WithdrawServlet.java
β β
β βββ domain/
β β βββ Account.java
β β βββ Customer.java
β β βββ Transaction.java
β β βββ Type.java
β β
β βββ exceptions/
β β βββ AccountNotFoundException.java
β β βββ InsufficientBalanceException.java
β β βββ ValidationException.java
β β
β βββ repository/
β β βββ AccountRepository.java
β β βββ CustomerRepository.java
β β βββ TransactionRepository.java
β β
β βββ services/
β β βββ impl/
β β βββ BankService.java
β β
β βββ util/
β βββ DBConnection.java
β βββ Validation.java
β
βββ resources/
β βββ schema.sql
β
βββ webapp/
βββ index.jsp
βββ OpenAccount.jsp
βββ Deposit.jsp
βββ Withdraw.jsp
βββ Transfer.jsp
βββ AccountStatement.jsp
βββ ListAccounts.jsp
βββ SearchAccount.jsp
βββ CloseUpPage.jsp
β
βββ error/
β βββ 404.jsp
β βββ 500.jsp
β βββ AccountNotFound.jsp
β βββ Database.jsp
β βββ InsufficientBalance.jsp
β βββ Validation.jsp
β
βββ css/
β βββ style.css
β
βββ WEB-INF/
βββ web.xml
The application uses MySQL for persistent storage.
The database schema is provided in:
src/main/resources/schema.sql
- Start the MySQL server.
- Open MySQL Workbench or the MySQL command line.
- Create the database required by the application.
- Execute
schema.sql. - Verify that the required tables have been created.
- Configure the database connection for your local environment.
The database connection is handled by:
src/main/java/util/DBConnection.java
Configure:
Database URL
Username
Password
Use your own local database credentials. Do not commit personal or production database passwords to GitHub.
Customer
β
β 1
β
β *
Account
β
β 1
β
β *
Transaction
Java Application
β
βΌ
JDBC Driver
β
βΌ
MySQL Connection
β
βΌ
PreparedStatement
β
βΌ
SQL Query
β
βΌ
ResultSet / Database Update
Maven is used to manage project dependencies, compilation, and packaging.
The central Maven configuration is:
pom.xml
Because this is a Java web application, it is packaged as a WAR:
<packaging>war</packaging>mvn clean compilemvn clean packageThe generated WAR file is placed inside:
target/
For this project:
target/advancejavabankingapp.war
The WAR can then be deployed to an Apache Tomcat webapps/ directory.
Install the following:
- Java JDK 25 or compatible JDK
- Maven
- MySQL
- Apache Tomcat
- Git
You can use an IDE such as IntelliJ IDEA, Eclipse, or VS Code.
git clone https://github.com/ateeburrahaman3/Advance-Java-Web-Banking-Application.gitNavigate into the project:
cd Advance-Java-Web-Banking-ApplicationStart MySQL and execute:
src/main/resources/schema.sql
Then configure the local database credentials in:
src/main/java/util/DBConnection.java
Use your own username and password.
java -versionThe project is configured for Java 25.
mvn -versionMake sure Maven is using the intended JDK.
Run:
mvn clean packageIf the build succeeds, Maven generates:
target/advancejavabankingapp.war
Copy:
target/advancejavabankingapp.war
into:
<TOMCAT_HOME>/webapps/
Start Apache Tomcat.
Tomcat will deploy the WAR as a web application.
Open:
http://localhost:8080/advancejavabankingapp/
The banking application's web interface should appear.
Once the application is running:
Provide:
- Customer name
- Account type
- Initial deposit
Submit the form to create the customer and account.
Provide:
- Account number
- Amount
The balance is updated and the transaction is recorded.
Provide:
- Account number
- Amount
- Note
The application checks the account and available balance before processing the withdrawal.
Provide:
- Sender account
- Receiver account
- Amount
The application validates both accounts, the amount, and the sender's available balance before processing the transfer.
Provide an account number to view account information and transaction history.
View available accounts stored in the database.
Search for an account using its account number.
The application uses custom exceptions and web.xml error mappings to provide dedicated error pages.
| Error | Handling |
|---|---|
| Account does not exist | AccountNotFoundException |
| Insufficient balance | InsufficientBalanceException |
| Invalid input | ValidationException |
| Database failure | Database/SQL error handling |
| Invalid URL | HTTP 404 |
| Unexpected server failure | HTTP 500 |
Conceptually:
Application / HTTP Error
β
βΌ
web.xml
β
βΌ
Dedicated Error JSP
This keeps technical exception details away from the normal user interface and provides clearer feedback when an operation fails.
The current application provides a foundation for moving toward a modern Java backend stack.
Potential next steps include:
- π Spring Boot REST API
- ποΈ Spring Data JPA / Hibernate
- π Spring Security
- π JWT-based authentication
- π₯ Role-based authorization
- π RESTful API documentation with OpenAPI/Swagger
- π§ͺ Automated unit and integration testing
- π Structured application logging
- π Transaction pagination and filtering
- π³ Docker containerization
- βοΈ Cloud deployment
- βοΈ React-based frontend
- π Monitoring and production observability
This project helped strengthen practical understanding of:
- Building a Java web application from the ground up
- Designing layered backend applications
- Handling HTTP requests using Servlets
- Creating dynamic web pages using JSP/JSTL
- Connecting Java applications to MySQL using JDBC
- Writing database operations using repositories
- Separating business rules from database and presentation logic
- Designing and using custom exceptions
- Managing dependencies with Maven
- Packaging Java web applications as WAR files
- Deploying applications using Apache Tomcat
- Using Git and GitHub for version control
Java Backend Development
Java Β· JDBC Β· MySQL Β· Servlets Β· JSP Β· JSTL Β· Maven Β· Apache Tomcat
Software Engineering
OOP Β· Layered Architecture Β· Repository Pattern Β· Service Layer Β· Exception Handling Β· Validation Β· Separation of Concerns
Development Tools
Git Β· GitHub Β· Maven Β· MySQL Workbench Β· IDE
Electronics & Communication Engineering Graduate
Aspiring Java Backend Developer
π§ Email: ateeburrahaman3@gmail.com
π LinkedIn: https://www.linkedin.com/in/ateeb-ur-rahaman/
π GitHub: https://github.com/ateeburrahaman3
If you found this project useful or interesting, consider giving the repository a β on GitHub.






