10
Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Embed Size (px)

Citation preview

Page 1: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Copyright © 2011 - Curt Hill

Connectivity

Communicating with the Database

Page 2: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Copyright © 2011 - Curt Hill

Introduction

• Most DBMSs are servers that respond to clients

• How do the two connect over a LAN, Intranet or the Internet?

• Numerous ways• This discusses some of them

Page 3: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Locations

• If the server is running on the same machine as the client it is rather easy

• SQL Server likes:– Named pipes– TCP/IP– Shared memory

• If this is not the case then other options are needed

Copyright © 2011 - Curt Hill

Page 4: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Some of the possibilities

• CLI (Call Level Interface)• ODBC (Open DataBase

Connectivity)• JDBC (Java DataBase Connectivity)

Copyright © 2011 - Curt Hill

Page 5: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

CLI

• Call Level Interface• Defined for C and COBOL language

programs• Standardized by ISO• Determines the Application

Program Interface between a program and a remote database– Program could be as simple as an SQL

client or much more complicated

Copyright © 2011 - Curt Hill

Page 6: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

ODBC

• Based on CLI• Developed by Microsoft• A driver that takes SQL commands

– Translates them to specific DB– Transmits them to particular DB– Receives the result– Returns to the program

• Each DB manufacturer generally produces the ODBC driver for each platform

Copyright © 2011 - Curt Hill

Page 7: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

ODBC Again

• Like any driver, the goal is to bridge the differences between DBMSs

• Eg. an application that deals with Oracle through the Oracle ODBC can change to SQL Server by only changing the ODBC

• The OS will have a ODBC driver manager– It chooses the best of the installed

drivers for the DBMS in question Copyright © 2011 - Curt Hill

Page 8: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

JDBC

• Java DataBase Connectivity• Connects Java appliations with

DBMSs • Usually just an interface to ODBC

from within Java

Copyright © 2011 - Curt Hill

Page 9: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Some Others• ADO – ActiveX Data Object

• The .NET version is how .NET programs communicate

• OLE DB – Object Linking and Embedding for DataBases

• Extends ODBC to allow access to programs that do not accept SQL

• Such as object databases and spreadsheets

• DAO – object oriented API• Usually for local data sources

• RDO – remote data objects• Uses DAO and ODBC

Copyright © 2011 - Curt Hill

Page 10: Copyright © 2011 - Curt Hill Connectivity Communicating with the Database

Finally

• Each of these described protocols is middleware

• It sits between an application program and a target database

• Makes it easier to change databases with changing the application

Copyright © 2011 - Curt Hill