The Student Bank Application is a Java-based system that simulates basic banking operations, including account creation, modification, deletion, balance checks, and transactions (deposit/withdrawal). It uses Hibernate ORM for database management and MySQL as the database system. Users interact via a command-line interface (CLI).
- Java: Core programming language for application logic.
- Hibernate: ORM framework for database interactions.
- MySQL: Relational database for storing account data.
- Eclipse IDE: IDE used for development and code management.
- JDBC: Database connectivity implemented via Hibernate.
- Spring Boot (Optional): Simplifies configurations if integrated.
Represents bank account data with the following properties:
- AccNumber: Unique account number.
- Balance: Current balance.
- Name: Account holder’s name.
- PhoneNumber: Associated phone number.
Includes getters and setters for interaction.
Handles database operations via Hibernate:
- Insert Account: Create a new account.
- Delete Account: Remove an account.
- Modify Account: Update details (name, phone).
- Read Account: Retrieve account details.
- Money Transaction: Deposit or withdraw money.
Uses Session and Transaction objects to manage persistence.
Provides a command-line interface for user actions:
- Create Account
- Delete Account
- Modify Account
- Check Details
- Deposit/Withdraw Money
- Exit Application
Interacts with BankDAO22 to execute user-selected operations.
Ensure MySQL is installed. Create a database named StudentBank.
Edit hibernate.cfg.xml with MySQL credentials (username, password) and database URL.
- Import the project into Eclipse IDE.
- Add required Hibernate dependencies.
Hibernate auto-generates database tables based on configuration mappings.
Set hbm2ddl.auto to update in hibernate.cfg.xml.
Run the App class to launch the CLI. Options include:
- Create New Account: Enter account number, name, phone number, and balance.
- Delete Account: Enter account number to delete.
- Modify Account: Update name or phone number.
- Check Details: View account information.
- Money Transactions: Deposit or withdraw funds.
- Exit Program: Close the application.
CRUD operations (Create, Read, Update, Delete) are performed through Hibernate ORM.
Configures Hibernate properties, including:
- Database Connection: URL, username, password.
- Dialect: MySQL dialect.
- Mappings: Links to Account.hbm.xml.
Maps AccountDTO22 class properties to the database table fields.
Ensure the MySQL server is running and reachable.
Minimal validation is implemented. Avoid invalid entries (e.g., incorrect account numbers).
Contributions are welcome!
- Fork the repository.
- Create a new branch.
- Submit a pull request