Skip to content

Latest commit

Β 

History

15 Commits

Folders and files

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

Repository files navigation

Advance Java Web Banking Application Banner

🏦 Advance Java Web Banking Application

A Java Web-Based Banking Application built with Servlets, JSP, JDBC, MySQL, Maven and Apache Tomcat

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.


Java JDBC Servlets JSP Maven MySQL Tomcat Git


πŸ“– Table of Contents


πŸ“š About

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.


✨ Features

🏦 Open Account

Create a new customer account by providing:

  • Customer name
  • Email
  • Account type
  • Initial deposit

Open Account


πŸ’° Deposit Money

Deposit money into an existing account.

Deposit


πŸ’Έ Withdraw Money

Withdraw money after validating the account and available balance.

Withdraw


πŸ”„ Transfer Money

Transfer money from one account to another.

The operation validates:

  1. Sender account
  2. Receiver account
  3. Transfer amount
  4. Sender's available balance

Transfer


πŸ“„ Account Statement

Search an account and view its transaction history.

Account Statement


πŸ”Ž Search and πŸ“‹ List Accounts

The application provides operations for:

  • Searching for a specific account
  • Listing available accounts

Search and List Accounts


⚠️ Error Handling

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

Error Handling


πŸ— Architecture

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       β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Separation of Responsibilities

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.


πŸŽ₯ Project Demonstration

The repository contains GIF demonstrations of the main application workflows.

🏦 Open Account

Open Account

πŸ’° Deposit

Deposit

πŸ’Έ Withdraw

Withdraw

πŸ”„ Transfer

Transfer

πŸ“„ Account Statement

Account Statement

πŸ”Ž Search & πŸ“‹ List Accounts

Search and List Accounts

⚠️ Error Handling

Error Handling


πŸ›  Technologies Used

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

🧠 Java and Backend Concepts

This project demonstrates practical application of several Java and backend development concepts.

Core Java

  • Object-Oriented Programming
  • Encapsulation
  • Abstraction
  • Interfaces
  • Enums
  • Classes and objects
  • Exception handling
  • Custom exceptions

Database Development

  • JDBC
  • SQL
  • PreparedStatement
  • ResultSet
  • CRUD operations
  • Database connectivity

Application Architecture

  • Layered architecture
  • Repository pattern
  • Service layer
  • Separation of concerns
  • DTO usage
  • Domain models
  • Validation

Java Web Development

  • HTTP request/response handling
  • Servlets
  • JSP
  • JSTL
  • web.xml
  • Error-page configuration
  • WAR packaging
  • Servlet-container deployment

Build and Project Management

  • Maven dependencies
  • Maven lifecycle
  • Maven packaging
  • Git and GitHub

🌐 Request Flow

A typical request travels through the application as follows:

Browser
   β”‚
   β”‚ HTTP Request
   β–Ό
Servlet
   β”‚
   β–Ό
Service
   β”‚
   β–Ό
Repository
   β”‚
   β–Ό
MySQL
   β”‚
   β–Ό
Repository
   β”‚
   β–Ό
Service
   β”‚
   β–Ό
Servlet
   β”‚
   β–Ό
JSP
   β”‚
   β–Ό
Browser

Example: Withdrawal

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.


πŸ“‚ Project Structure

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

πŸ—„οΈ Database

The application uses MySQL for persistent storage.

The database schema is provided in:

src/main/resources/schema.sql

Database Setup

  1. Start the MySQL server.
  2. Open MySQL Workbench or the MySQL command line.
  3. Create the database required by the application.
  4. Execute schema.sql.
  5. Verify that the required tables have been created.
  6. Configure the database connection for your local environment.

Database Configuration

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.

Database Relationship

Customer
   β”‚
   β”‚ 1
   β”‚
   β”‚ *
Account
   β”‚
   β”‚ 1
   β”‚
   β”‚ *
Transaction

JDBC Flow

Java Application
       β”‚
       β–Ό
JDBC Driver
       β”‚
       β–Ό
MySQL Connection
       β”‚
       β–Ό
PreparedStatement
       β”‚
       β–Ό
SQL Query
       β”‚
       β–Ό
ResultSet / Database Update

πŸ“¦ Maven Build and WAR Packaging

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>

Build the Project

mvn clean compile

Create the Deployable WAR

mvn clean package

The 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.


πŸš€ Getting Started

Prerequisites

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.


1. Clone the Repository

git clone https://github.com/ateeburrahaman3/Advance-Java-Web-Banking-Application.git

Navigate into the project:

cd Advance-Java-Web-Banking-Application

2. Configure MySQL

Start 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.


3. Verify Java

java -version

The project is configured for Java 25.


4. Verify Maven

mvn -version

Make sure Maven is using the intended JDK.


5. Build the Application

Run:

mvn clean package

If the build succeeds, Maven generates:

target/advancejavabankingapp.war

6. Deploy to Apache Tomcat

Copy:

target/advancejavabankingapp.war

into:

<TOMCAT_HOME>/webapps/

Start Apache Tomcat.

Tomcat will deploy the WAR as a web application.


7. Open the Application

Open:

http://localhost:8080/advancejavabankingapp/

The banking application's web interface should appear.


πŸ‘€ How to Use

Once the application is running:

1. Open Account

Provide:

  • Customer name
  • Email
  • Account type
  • Initial deposit

Submit the form to create the customer and account.

2. Deposit

Provide:

  • Account number
  • Amount

The balance is updated and the transaction is recorded.

3. Withdraw

Provide:

  • Account number
  • Amount
  • Note

The application checks the account and available balance before processing the withdrawal.

4. Transfer

Provide:

  • Sender account
  • Receiver account
  • Amount

The application validates both accounts, the amount, and the sender's available balance before processing the transfer.

5. Account Statement

Provide an account number to view account information and transaction history.

6. List Accounts

View available accounts stored in the database.

7. Search Account

Search for an account using its account number.


⚠️ Error Handling

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.


πŸ’‘ Future Enhancements

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

🎯 Learning Outcomes

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

πŸ’Ό Skills Demonstrated

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


πŸ‘¨β€πŸ’» Author

Ateeb Ur Rahaman

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


⭐ Support

If you found this project useful or interesting, consider giving the repository a ⭐ on GitHub.


🏦 Advance Java Web Banking Application

Built to strengthen Java backend fundamentals and progress toward modern Java backend development.

About

A Java web-based banking application built with JDBC, MySQL, Servlets, JSP, JSTL, Maven and Apache Tomcat, following a layered architecture.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages