DBI: The Neophyte’s Guide

Introduction

What’s in this talk?

What’s not in this talk?!

What is DBI?

What are DBDs?

Why do we need the DBI?

What about ODBC?

What is oraperl? Ingperl? ...

DBI Resources

Any Questions?

DBI Architecture

Architectural Overview

A Handy Reminder

Handles

Architectural Overview of Handles

Driver Handles

Driver Handle Implications

Database Handles

Database Handle Implications

Statement Handles

Statement Handle Implications

Handle Naming Conventions

Any Questions?

Starting Out with DBI

Initializing the DBI

Data Sources

Data Sources ( cont. )

Data Sources ( cont. )

Data Sources ( cont. )

Checking Available Drivers

listdsns: Lists available data sources

listdsns: Sample Output

Connecting to the Database

Disconnecting from the Database

Example 1

Example 2

Example 3

Any Questions?

Interacting with the Database

Simple Queries

Preparing the Statement

Preparing the Statement ( cont. )

Preparing the Statement ( cont. )

Executing the Statement

Fetching the Data

Fetching Data - Example 1

Fetching Data - Example 2

Fetching the Data

Finishing the Statement

Non-SELECT Statements

Non-SELECT Statements ( cont. )

Bind Values

Bind Values ( cont. )

Bind Values ( cont. )

Bind Values ( cont. )

Bind Values ( cont. )

Bind Values ( cont. )

Bind Values ( cont. )

Optimizing $dbh->do()

Optimizing $dbh->do()

Any Questions?

Database Proxying

Proxy Architecture

Proxy Server Setup

Proxy Client Setup

Proxy Client Setup ( cont. )

Proxying Data Flow

Proxying Data Flow ( cont. )

Benefits of Proxying

Demonstration Database Tables

Final Questions and Answers