ODBC presentation Rob John Phill

Document Sample
ODBC presentation Rob John Phill Powered By Docstoc
					Open Database Connectivity
         (ODBC)

      A Presentation by

       John O’Connor
       Philip Simpson
        Robert Steele


        Robert Steele, John O'Conner,
                Phil Simpson
      Structure of Presentation
•   What is ODBC?
•   Why is it needed?
•   The basis of ODBC
•   ODBC components
•   Bridges
•   Conformance Levels
•   Future?

               Robert Steele, John O'Conner,
                       Phil Simpson
          What is ODBC?
• A specification for a standard language-
independent database API
• Provides an application developer with a
common library of functions to access varied
data sources
•Based on the CLI specifications of X/Open
and the ISO/IEC

               Robert Steele, John O'Conner,
                       Phil Simpson
      Why is OBDC needed?
• Organizations used to work with a single
  data source




               Robert Steele, John O'Conner,
                       Phil Simpson
     Why is OBDC needed?
• Emergence of the need to access varied
  data sources




              Robert Steele, John O'Conner,
                      Phil Simpson
      Why is OBDC needed?
• ODBC – The data connectivity solution




               Robert Steele, John O'Conner,
                       Phil Simpson
         The Basis of ODBC
• A standard API for applications

• SQL

• Statement Level Interface

• Call Level Interface

                Robert Steele, John O'Conner,
                        Phil Simpson
                       SQL
• Before SQL
• SQL developed by IBM in 1970s
• SQL standardized by ANSI in 1986 and by
  ISO in 1987
• Using SQL in applications
  – Statement Level Interface
  – Call Level interface


                Robert Steele, John O'Conner,
                        Phil Simpson
    Statement Level Interface
• Embedded SQL

• Static SQL

• Dynamic SQL

• Requires Pre-Compilation

               Robert Steele, John O'Conner,
                       Phil Simpson
 Problem with SLI
EXEC SQL INCLUDE SQLCA;
EXEC SQL BEGIN DECLARE SECTION;
   int OrderID;
        int CustID;
   char SalesPerson[10];
   char Status[6]

EXEC SQL END DECLARE SECTION;

EXEC SQL WHENEVER SQLERROR GOTO q_error;
EXEC SQL WHENEVER NOT FOUND GOTO bad_num;

printf ("Enter order number: ");
scanf ("%d", &OrderID);

EXEC SQL SELECT CustID, SalesPerson, Status
   FROM Orders
   WHERE OrderID = :OrderID
INTO :CustID, :SalesPerson, :Status;

         Robert Steele, John O'Conner,
                 Phil Simpson
         Call Level Interface
• A function library for database access

• No need for pre-compilation

• Created by the SQL Access Group

• The basis of ODBC

               Robert Steele, John O'Conner,
                       Phil Simpson
         ODBC components
• Application
  – Spreadsheet, web server,
  Database front end,
  word Processor

• The driver manager
  – Interfaces with Application and loads Drivers

• The driver (2 types)
  – Processes requests, SQL, Errors for DBMS
                 Robert Steele, John O'Conner,
                         Phil Simpson
    Driver Architecture & Tiers
• Tier’s
   – 1. File based driver
   – 2. DBMS based driver
   – 3. Gateway




                                     Example: SQL Server -> DB2
                                     Micro decisionware DB2 gateway
                                     Makes DB2 looks like SQL Server
                  Robert Steele, John O'Conner,
                          Phil Simpson
*           JDBC-ODBC bridge

    • No driver found – Use bridge
    •Converts requests to the other language
    • Access windows programs on Linux
    • Java can then access any ODBC
    compliant database
    • Works for the reverse!

                  Robert Steele, John O'Conner,
                          Phil Simpson
JDBC – ODBC Architecture




       Robert Steele, John O'Conner,
               Phil Simpson
*           ODBC conformance
    • DBMS must conform to ODBC standard
    • Each DBMS meets a particular degree
    • Three levels
       – Core level
       – Level 1
       – Level 2
    • Higher level = greater features
    • Level resides within the driver – Can be
      Queried
                   Robert Steele, John O'Conner,
                           Phil Simpson
ODBC Conformance Levels




       Robert Steele, John O'Conner,
               Phil Simpson
*
             SQL conformance
    • The level of SQL that DBMS understands
    • Three levels
      – Minimum
      – Core
      – Extended
    • Alternate queries depending on level
      – Maximise performance


                   Robert Steele, John O'Conner,
                           Phil Simpson
SQL Conformance Levels




      Robert Steele, John O'Conner,
              Phil Simpson
*           The future of ODBC
    • Microsoft's OLE-DB
    • Higher level replacement
      – Spreadsheets
      – Non-relational databases
      – Text files to Oracle
    • OLE-DB faster than ODBC – Extra layer
    • MS support for 16-bit dropped – OLE-DB
    • BUT Large customer base for ODBC

                  Robert Steele, John O'Conner,
                          Phil Simpson
OLE-DB vs ODBC




   Robert Steele, John O'Conner,
           Phil Simpson
 Thank you
Any Questions



  Robert Steele, John O'Conner,
          Phil Simpson

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:24
posted:10/22/2011
language:English
pages:22