Java Swing ATM simulation backed by MySQL and JDBC.
This project simulates a desktop ATM workflow with account registration, login, and core banking actions. It is built as a Java Swing application and uses MySQL for user, account, and transaction data.
- Secure login with card number and PIN
- New user registration across three signup pages
- Adult/minor account handling
- Adults can receive ATM card credentials
- Applicants below 18 are restricted to joint accounts with a nominee
- Deposit, withdraw, balance enquiry, and fast cash
- Transaction logging in MySQL
- ATM-style navigation with back and home actions
- Java
- Java Swing
- MySQL
- JDBC with MySQL Connector/J
- IntelliJ IDEA
- Java JDK installed and configured in IntelliJ IDEA
- MySQL Server running locally
- MySQL Connector/J available in
lib/mysql-connector-j-9.5.0.jar
src/Login.java- application entry point and login screensrc/SignUpPageOne.java- personal details and DOB validationsrc/SignUpPageTwo.java- additional applicant detailssrc/SignUpPageThree.java- account creation rules and final setupsrc/ATMMenu.java- transaction menu after loginsrc/Deposit.java- deposit screensrc/Withdraw.java- withdraw screensrc/FastCash.java- preset withdrawal amountssrc/BalanceEnquiry.java- balance screensrc/DBConnection.java- JDBC connection and schema checkssrc/database.sql- base schema and sample datalib/mysql-connector-j-9.5.0.jar- MySQL JDBC driver
- Users aged 18 or above can open a normal account and receive an ATM card and PIN.
- Users below 18 are restricted to a joint account with a nominee.
- Minors do not receive ATM card credentials during signup.
The application connects to MySQL database atmdb.
- Create the database in MySQL.
- Run the SQL script from
src/database.sql. - Confirm the MySQL server is running before starting the app.
DBConnection.java also creates the runtime tables accounts and transactions if they are missing, and it adds required columns to signup_page2 when needed.
If environment variables are not set, the app uses the fallback values currently defined in src/DBConnection.java:
- URL:
jdbc:mysql://localhost:3306/atmdb?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC - User:
root - Password:
Saikiran@123
Change these before sharing the project publicly if they are real local credentials.
The SQL script includes an optional seeded user for testing:
- Card Number:
1234567890123456 - PIN:
1234
- Open the project folder in IntelliJ IDEA.
- Set the project SDK to a working Java version.
- Add
lib/mysql-connector-j-9.5.0.jaras a library if IntelliJ does not detect it automatically. - Ensure MySQL is running and the
atmdbschema is available. - Open
src/Login.javaand run themainmethod.
The app supports these environment variables:
ATM_DB_URLATM_DB_USERATM_DB_PASS
If they are not set, the code falls back to the defaults in src/DBConnection.java.
If you want to run the project outside IntelliJ:
javac -cp "lib/mysql-connector-j-9.5.0.jar" -d out src\*.java
java -cp "out;lib/mysql-connector-j-9.5.0.jar" Login- This is a Swing desktop application, so final verification is manual.
- Fast cash transactions are stored with transaction type
FAST_CASH. - IDE-specific folders such as
.vscodeand.ideaare not required for running the project. - The repository is intended to be run through standard source files and database setup, not IDE-generated build artifacts.