Java Database Connectivity (JDBC) Course

Course Code: IN 144
Course Abstract:

This course covers Java's standard database access API: JDBC. It goes beyond the basics of the API syntax, discussing performance-enhancing techniques like prepared statements and scrollable result sets. It addresses advanced issues such as database transactions and primary key generation. It includes a complete discussion of object-to-relation mapping, including how to map database relationships to customized Java collections.

Audience:

This course is designed for developers who wish to access relational database information from Java programs.

Duration: 2 days
Learning Outcomes:

Upon completion of this course, the participant will be able to:
> Access and manipulate information in relational databases from Java programs
> Create JDBC-enabled business objects compliant with the Java Bean standard
> Perform JDBC-based transactions and primary key generation
> Efficiently access bulk data with prepared statements and scrollable result sets
> Create object-to-relational mappings for complex business applications

Course Topics:

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

Prerequisites:

Prior experience with the core features of the Java language and a familiarity with relational databases are required.

Note: All fields are required
At the present time we do not offer training for individuals or groups less then 6 individuals. We apologize for any inconvenience.


We Value Your Privacy!

Ready to get started or in need of more information? Contact us today.

Go To Blog Virtual Learning