Welcome to Database Access Tutorial
This educational project demonstrates essential JDBC database operations through practical, real-world examples. You’ll learn how to work with embedded databases, manage transactions, handle concurrency, and build complete CRUD applications in Java.Quick Start
Get up and running with your first database application in minutes
Installation
Set up your development environment with Java and database drivers
CRUD Operations
Master create, read, update, and delete operations
Examples
Explore complete working examples with HSQLDB and H2
Key Features
Dual Database Support
Work with both HSQLDB and H2 embedded databases with identical schemas
Transaction Management
Learn proper transaction handling with commit, rollback, and isolation levels
Concurrency Patterns
Understand race conditions and atomic operations through counter examples
Enterprise Schema
Practice with a realistic employee management system including centers, departments, and employees
Configuration Management
External configuration via properties files for flexible deployment
JAR Deployment
Package applications as portable JAR files for easy distribution
What You’ll Learn
JDBC Fundamentals
JDBC Fundamentals
- Establishing database connections with DriverManager
- Using PreparedStatement for parameterized queries
- ResultSet navigation and data retrieval
- Resource management with try-with-resources
Transaction Control
Transaction Control
- setAutoCommit() for manual transaction control
- commit() and rollback() operations
- FOR UPDATE row locking
- Isolation levels and deadlock prevention
Database Schema Design
Database Schema Design
- Foreign key relationships
- Primary key constraints
- Data type selection (INTEGER, VARCHAR, DATE, DECIMAL)
- Referential integrity
Real-World Patterns
Real-World Patterns
- Connection pooling considerations
- Error handling and exception management
- Updatable ResultSets vs. SQL UPDATE statements
- Configuration externalization
Project Structure
The project includes several focused examples:- DB_Enterprise - Configuration-driven database connection setup
- DB_EnterpriseHSQLDB - Complete employee management system with HSQLDB
- DB_EnterpriseH2 - Complete employee management system with H2
- Counter Implementations - Various approaches to thread-safe counter operations
- CrearJar - Utility for packaging applications as executable JARs
Database Schema
The enterprise management examples use a three-table schema:Getting Started
This is an educational project designed for learning JDBC concepts. The examples prioritize clarity and demonstration of specific patterns over production-ready architecture.
Next Steps
Follow the Quickstart
Run your first example and explore the interactive menu
Explore Components
Learn about configuration management and database connections