Navigation: Main Tutorial Index | Chapter Guide
This folder contains solutions for all 40 JDBC practice exercises.
Set MYSQL_URL, MYSQL_USER, and MYSQL_PASSWORD for your local MySQL server before running database programs.
export MYSQL_URL="jdbc:mysql://localhost:3306/studentdb"
export MYSQL_USER="root"
export MYSQL_PASSWORD="your-password"javac 01-DatabaseConnection.java
java DatabaseConnection- Database Connection
- Create Database
- Create Student Table
- Insert Student Using Statement
- Retrieve All Students
- Retrieve Student by ID
- Update Student Marks
- Delete Student by ID
- Display with PreparedStatement
- Count Student Records
- PreparedStatement Batch Insert
- Batch Update
- Delete Low-Marks Students
- Search Students by Name
- Students with Marks Above 80
- SQL Injection and PreparedStatement
- Transaction Commit
- Transaction Rollback
- Money Transfer Transaction
- CallableStatement
- Stored Procedure OUT Parameter
- DatabaseMetaData
- ResultSetMetaData
- Retrieve Generated Keys
- Try-With-Resources JDBC
- Student Management JDBC
- Employee CRUD JDBC
- Student DAO Pattern
- Bank Account Transaction
- Login with PreparedStatement
- Batch Insert Thousands
- Library Management JDBC
- Simple JDBC Connection Pool
- Inventory Management JDBC
- Order Management JDBC
- Pagination with LIMIT and OFFSET
- Duplicate Email Handling
- Two-Table Transaction
- DAO and Service Layer
- Complete Console Student Management