ATM Machine Simulation Project π Project Overview A Java-based ATM simulation system built using Servlet, JSP, JDBC, MySQL, and HTML. This project simulates real ATM operations with user authentication, transaction processing, and session management.
π Features β User Registration (Set PIN)
β Secure Login Authentication
β Deposit Money
β Withdraw Money
β Balance Inquiry
β PIN Change Facility
β Session Management
β Database Persistence
β Responsive HTML Interface
β Error Handling with Popups
π οΈ Technologies Used Backend: Java Servlet, JDBC
Frontend: HTML, JSP, JavaScript
Database: MySQL
Server: Apache Tomcat
IDE: NetBeans (Recommended)
Build Tool: Maven (Standard)
π Project Structure text ATM_Simulation_Project/ β βββ src/main/java/ β βββ setpin.java # Main Servlet handling all operations β βββ src/main/webapp/ β βββ index.html # Home page with options β βββ setpin.html # User registration page β βββ atm.html # Login page β βββ atmoperation.html # Operations menu β βββ deposit.html # Deposit form β βββ withdraw.html # Withdraw form β βββ balance.html # Balance check form β βββ changepin.html # Change PIN form β βββ WEB-INF/ β βββ web.xml # Servlet configuration β βββ database/ β βββ atm_database.sql # Database schema β βββ lib/ # JDBC driver (mysql-connector-java-8.0.xx.jar) βββ README.md # This file βββ pom.xml # Maven configuration ποΈ Database Setup
- Create Database sql CREATE DATABASE atmmachine; USE atmmachine;
- Create Users Table sql CREATE TABLE setpin ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, pin VARCHAR(6) NOT NULL, cpin VARCHAR(6) NOT NULL, balance DECIMAL(10,2) DEFAULT 0.00, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
- (Optional) Create Transactions Table sql CREATE TABLE transactions ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, transaction_type VARCHAR(20), amount DECIMAL(10,2), balance_after DECIMAL(10,2), transaction_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES setpin(id) ); βοΈ Installation & Setup Prerequisites Java JDK 8 or higher
Apache Tomcat 9 or higher
MySQL 5.7 or higher
NetBeans IDE (or Eclipse/IntelliJ)
MySQL Connector/J driver
Step 1: Clone/Download Project bash git clone https://github.com/yourusername/atm-simulation.git Step 2: Database Configuration Start MySQL server
Execute atm_database.sql script
Update database credentials in setpin.java:
java return DriverManager.getConnection( "jdbc:mysql://localhost:3306/atmmachine", "root", "yourpassword" ); Step 3: Configure Project in IDE NetBeans:
File β New Project β Java Web β Web Application
Copy files to respective folders
Add MySQL Connector to Libraries
Eclipse:
File β New β Dynamic Web Project
Copy files to WebContent folder
Add MySQL Connector to Build Path
Step 4: Deploy and Run Build the project
Deploy to Tomcat server
Access application: http://localhost:8080/ATM_Simulation/
π Application Flow Home Page (index.html) β Choose Set PIN or ATM Operations
Registration (setpin.html) β Create account with name and PIN
Login (atm.html) β Enter credentials for authentication
Operations Menu (atmoperation.html) β Choose transaction type
Perform Operations β Deposit/Withdraw/Balance/Change PIN
Logout β Session destroyed, return to home
π Security Features Password hashing (if implemented in future)
Session-based authentication
SQL injection prevention using PreparedStatement
Input validation on client and server side
Automatic session timeout
π§ͺ Testing the Application Test Cases: User Registration:
Enter valid credentials β Success popup
Mismatched PINs β Error message
Duplicate username β Error message
Login:
Valid credentials β Welcome message
Invalid credentials β Error message
Transactions:
Deposit positive amount β Balance increases
Withdraw within limit β Balance decreases
Withdraw exceeding balance β Error message
Balance check β Display current balance
PIN change with verification β Success message
π Troubleshooting Issue Solution 404 Error Check servlet mapping in web.xml Database Connection Failed Verify MySQL credentials and service Session not working Check session attribute names match Popups not showing Enable JavaScript in browser Tomcat deployment error Clean and rebuild project π Future Enhancements Add transaction history
Implement email/SMS notifications
Add admin panel for user management
Implement biometric authentication
Add multi-language support
Create mobile-responsive design
Implement REST API version
π₯ Contributor Guidelines Fork the repository
Create a feature branch (git checkout -b feature/AmazingFeature)
Commit changes (git commit -m 'Add AmazingFeature')
Push to branch (git push origin feature/AmazingFeature)
Open a Pull Request
π License This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments Java Servlet Documentation
MySQL Official Documentation
Apache Tomcat Team
All contributors and testers
π§ Contact Developer: SANTHOSH M Email: santhosh473abi@gmail.com GitHub: https://github.com/Santhoshabi473
β If you find this project useful, please give it a star! β
π Quick Start Commands For Windows: bash
net start mysql
catalina start
start http://localhost:8080/ATM_Simulation/ For Linux/Mac: bash
sudo systemctl start mysql
./catalina.sh start
MySQL Connector/J
Happy Coding! π―