JDBC Fundamentals
Relational Databases
Database and Client/Server
Tables
Foreign Key Relationships
Structured Query Language
SQL for Table Creation
Database Access for Applications
JDBC Architecture
Driver Types
JDBC Class Hierarchy
A Simple JDBC Example
Loading Drivers
Connections to the Database
Utility Class: Connection Factory
connect() and close()
Executing SQL Commands
Processing ResultSets
Importance of Try/Catch/Finally
Review: JDBC Fundamentals
Lab: JDBC Fundamentals
JDBC Statements, Types and Business Objects
Statement Types
Prepared Statements
Setting Statement Parameters
Advantages of Prepared Statements
Callable Statements
Java Types and Database Types
Java and SQL Dates
Working with SQL NULL
Setting Parameters to SQL NULL
JDBC-Based Business Objects
Business Object Properties
Item's load() Method
Item's listAll() Method
Item's remove() Method
Item's store() Method
Item's create() Method
Item's save() Method
Using Business Objects
Review: Statements and Objects
Lab: Statements and Objects
JDBC Transactions and Primary Key Generation
Connection Pooling
Retrieving Pooled Connections
DataSources
Using DataSources
Closing Pooled Connections
Transactions
JDBC Transactions
Transaction Example
Transactions and Concurrency
Transaction Isolation
Primary Key Generation
IdMaker
IdMaker Class Outline
loadIdFromDB() Outline
A Table-Specific IdMaker
Review: Transactions and Keys
Lab: Transactions and Keys
Scrollable Resultsets
Scrollable Result Sets
Updateable Result Sets
Creating Scrollable Result Sets
Kinds of Scrolling and Updates
Scrolling Navigation Methods
Position Location Methods
Forward and Backward Loops
Fetch Control Properties
Batch Fetches
Batch Fetches without Scrolling
Updateable Resultsets
Field Update Methods
The Insert Row 79
Using the Insert Row
Deleting Rows
Uses for Scrollable Result Sets
Review: Scrollable ResultSets
Lab: Scrollable ResultSets
JDBC Metadata
Getting ResultSet Metadata
Kinds of ResultSet Metadata
Column Definition Data
Column Characteristic Data
Column Nullability Data
Example: Java Types for Column
Getting Database Metadata
Database Vendor Info
SQL Support Level Info
JDBC Support Level Info
Maximum Operation Values
Catalog Structure Info
Meta Data in Resultsets
Example: Get Primary Key Fields
Uses for Metadata
Review: JDBC Metadata
Lab: JDBC Metadata
A Lightweight Transaction Monitor
Issues with JDBC Transactions
Advanced Solutions
Simpler Approaches
How to Maintain the Context
ThreadLocal Variables
Thread-based Transactions
Example Transaction Class
Using the Transaction Class
How the Transaction Class Works
Handling Transaction Failure
Statement and Connection Closure
Sample Transactional Method
Another Transactional Method
Calling Transactional Methods
Limitations of Transaction Class
Review: Transaction Monitor
Lab: Transaction Monitor
Object-to-Relational Mapping
Object-to-Relational Mapping
Many-to-Many and One-to-Many
Java Collections
Collections for Business Objects
Persistable Interface
PersistCollection Class
save() for PersistCollection
PersistCollectionMtoM Class
save() for PersistCollectionMtoM
Custom Collections
Changes to the Business Objects
Examples of Using Collections
Other Optimizations
Review: Object-to-Relations
Lab: Object-to-Relations