JDBC ATM Management System Using Java
By HARISH SS
Simulate secure banking operations with a JDBC-based ATM system. Perform transactions, check balance, and ensure data integrity.
The code represents an ATM (Automated Teller Machine) simulation where users can perform banking operations such as checking balance, depositing money, and withdrawing money. The program consists of several classes:
-
Main Class:
- This class contains the main method and is the entry point of the program.
- It creates an instance of the UserDetail class and handles the user interaction by displaying a menu of options and executing the selected operation based on user input.
-
UserDetail Class:
- This class represents the user's account details and operations related to the user.
- It prompts the user to enter a PIN number and password when an instance of this class is created.
- The class has methods for checking the balance, verifying the password, depositing money, and withdrawing money.
- The checkBalance method retrieves the balance from the database for the user's account number and displays it to the user.
- The passCheck method verifies if the entered password matches the password stored in the database for the user's account number.
- The deposit method prompts the user to enter an amount to deposit, updates the balance in the database, and displays the updated balance.
- The withdraw method prompts the user to enter an amount to withdraw, checks if the withdrawal amount is within the available balance, updates the balance in the database if valid, and displays the updated balance.
-
dataBasecon Class:
- This class establishes a connection to the database using JDBC (Java Database Connectivity).
- It has a getConnection method that returns a Connection object, which is used by other classes to interact with the database.
The program follows a menu-driven approach, where the user is prompted to enter a PIN number and password. If the entered password is correct, the user is presented with a menu of options (check balance, deposit, withdraw, exit) and can choose an operation by entering the corresponding number. Based on the selected option, the program calls the respective method in the UserDetail class to perform the desired operation.
Overall, the code provides a basic implementation of an ATM system that interacts with a database to handle user account details and banking operations.
RESULT:
Enter user_detail:

CHECK BALANCE:

DEPOSIT AMOUNT AND DATABASE :

WITHDRAW AMOUNT AND DATABASE :

EXIT :

----------------------------------------------------------------------------END-----------------------------------------------------------------------
Comments