Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Connecting to a Database through Programs Database Systems.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Chapter 13 © 2000 Prentice Hall Chapter 13 Accessing the Database Server: ODBC, OLE DB, and ADO David M. Kroenke Database Processing © 2000 Prentice Hall.
Database Processing Applications and Business Intelligence Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
Prentice Hall © COS 346 Day Agenda Capstone Progress report due Assignment 9 not corrected yet Assignment 10 posted (last one!!!) –Due.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall COS 346 Day 23.
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
Fundamentals, Design, and Implementation, 9/e Chapter 6 Introduction to Structured Query Language (SQL)
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 COS 346 Day 22.
JDBC. In This Class We Will Cover: What SQL is What ODBC is What JDBC is JDBC basics Introduction to advanced JDBC topics.
Database Programming (using ADO) Universal Data Access – Microsoft strategy for providing access to information across the enterprise. – UDA provides high-performance.
Database Processing Applications Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Client-server database systems and ODBC l Client-server architecture and components l More on reliability and security l ODBC standard.
Concepts of Database Management Sixth Edition
Blue Group (ADO) 3/10/98 Universal Data Access with ActiveX Data Objects The Blue Group *Jennifer Kochan *Rebecca Orozco *Chris Papandria *Alicja Stanczak.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 David M. Kroenke’s Chapter Twelve: ODBC Database Processing: Fundamentals,
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
ODBC Open DataBase Connectivity a standard database access method developed by Microsoft to access data from any application regardless of which database.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 David M. Kroenke’s Chapter Twelve: ODBC, OLE DB, ADO, and ASP Part.
1 ODBC, OLE DB, ADO, and ASP. 2 Introduction  Because database applications today reside in a complicated environment, various standards have been developed.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
ODBC : Open Database Connectivity SNU OOPSLA Lab. October 2005.
© 2006 ITT Educational Services Inc. Course Name: IT390 Business Database Administration Unit 9 Slide 1 IT 390 Business Database Administration Unit 9:
Using Visual Basic 6.0 to Create Web-Based Database Applications
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Universal Data Access and OLE DB. Customer Requirements for Data Access Technologies High-Performance access to data Reliability Vendor Commitment Broad.
CSS/417 Introduction to Database Management Systems Workshop 4.
Concepts of Database Management Seventh Edition
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
Fundamentals, Design, and Implementation, 9/e by David M. Kroenke BSA206 Database Management Systems Lecture 21: Databases and the Web Chapters 12, 13.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Chapter 4: SQL Complex Queries Complex Queries Views Views Modification of the Database Modification of the Database Joined Relations Joined Relations.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 David M. Kroenke’s Chapter Twelve: ODBC, OLE DB, ADO, and ASP Part.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
+ Connecting to the Web Chapter 7. + Chapter Objectives Understand and be able to set up Web database processing Learn the basic concepts of Extensible.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
5-1 VISUAL J++ Colorado Technical University IT420 Tim Peterson.
1 CS 430 Database Theory Winter 2005 Lecture 10: Introduction to SQL.
Database Connectivity and Server-Side Scripting Chapter 12.
Basics of JDBC Session 14.
ODBC : Open Database Connectivity SNU OOPSLA Lab. October 2005.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Introduction Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
1 ADO Activex Data Objects. 2 ADO ADO allows users to access data easily from many existing databases (such as Access or Paradox) From ODBC compliant.
Database Processing Applications Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
R EMAINING TOPICS IN JDBC Sagun Dhakhwa. O VERVIEW Introduction to JDBC API Types of JDBC Drivers Introduction to ODBC.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Database Processing Applications and Business Intelligence
Accessing the Database Server: ODBC, OLE DB, and ADO
Database Processing Applications
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Chapter 10 ADO.
Database Processing: David M. Kroenke’s Chapter Twelve: Part One
Presentation transcript:

Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/2 Copyright © 2004 Introduction  Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers  Some of the traditional standards are –OBDC (Open Database Connectivity) is the early standard for relational databases –OLE DB is the Microsoft’s object-oriented interface for relational and other databases –ADO (Active Data Objects) is the Microsoft’s standard providing easier access to OLE DB data for the non- object-oriented programmer

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/3 Copyright © 2004 Web Server Data Environment  Web server needs to publish applications that involve different data types

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/4 Copyright © 2004 Role of OBDC

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/5 Copyright © 2004 Role of OLE DB

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/6 Copyright © 2004 Role of ADO

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/7 Copyright © 2004 OBDC  ODBC (Open Database Connectivity) standard provides a DBMS-independent means for processing relational database data  It was developed in the early 1990s by an industry committee and has been implemented by Microsoft and many other vendors  The goal is to allow a developer to create a single application that can access databases supported by different DBMS products without needing to be changed or recompiled

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/8 Copyright © 2004 ODBC Architecture

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/9 Copyright © 2004 OBDC Components  OBDC consists of data source, application program, drivermanager, and DBMS driver  Data source is the database, its associated DBMS, operating system, and network platform –An ODBC data source can be a relational database, a file server, or a spreadsheet  Applications program issues requests to create a connection with a data source

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/10 Copyright © 2004 OBDC Components (cont.)  Driver manager determines the type of DBMS for a given ODBC data source and loads that driver in memory  DBMS driver processes ODBC requests and submits specific SQL statements to a given type of data source –A single-tier driver processes both ODBC calls and SQL statements –A multiple-tier driver processes ODBC calls, but passes the SQL requests to the database server

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/11 Copyright © 2004 OBDC Driver Types

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/12 Copyright © 2004 Conformance Levels  Levels of conformance balance the scope of OBDC standard  Two types of conformance levels –ODBC conformance levels concern the features and functions that are made available through the driver’s application program interface (API) A driver API is a set of functions that the application can call to receive services –SQL conformance levels specify which SQL statements, expressions, and data types a driver can process

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/13 Copyright © 2004 ODBC Conformance Levels  Core API –Connect to data sources –Prepare and execute SQL statements –Retrieve data from a result set –Commit or rollback transactions –Retrieve error information  Level 1 API –Core API –Connect to data sources with driver-specific information –Send and receive partial results –Retrieve catalog information –Retrieve information about driver options, capabilities, and functions

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/14 Copyright © 2004 ODBC Conformance Levels  Level 2 API –Core and Level 1 API –Browse possible connections and data sources –Retrieve native form of SQL –Call a translation library –Process a scrollable cursor  Minimum SQL Grammar –CREATE TABLE, DROP TABLE –simple SELECT (does not include subqueries) –INSERT, UPDATE, DELETE –Simple expressions (A > B + C) –CHAR, VARCHAR, LONGVARCHAR data types

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/15 Copyright © 2004 SQL Conformance Levels  Core SQL Grammar –Minimum SQL Grammar –ALTER TABLE, CREATE INDEX, DROP INDEX –CREATE VIEW, DROP VIEW –GRANT, REVOKE –Full SELECT (includes subqueries) –Aggregate functions such as SUM, COUNT, MAX, MIN, AVG –DECIMAL, NUMERIC, SMALLINT, INTEGER, REAL, FLOAT, DOUBLE PRECISION data types

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/16 Copyright © 2004 SQL Conformance Levels (cont.)  Extended SQL Grammar –Core SQL Grammar –Outer joins –UPDATE and DELETE using cursor positions –Scalar functions such as SUBSTRING, ABS –Literals for date, time, and timestamp –Batch SQL statements –Stored Procedures  The capability of the minimum SQL grammar is very limited  Most drivers support at least the core SQL grammar

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/17 Copyright © 2004 ODBC Data Source  A data source is an ODBC data structure that identifies a database and the DBMS that processes it  Three types of data source names –A file data source is a file that can be shared among database users having the same DBMS driver and privilege –A system data source is local to a single computer and may be used by the operating system and any user on that system System data sources are recommended for Web servers To define a system data source name, the type of driver and the database need to be specified –A user data source is available only to the user who created it

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/18 Copyright © 2004 OLE DB  OLE DB is an implementation of the Microsoft OLE object standard –OLE DB objects are COM objects and support all required interfaces for such objects  OLE DB breaks the features and functions of a DBMS into COM objects, making it easier for vendors to implement portions of functionality –This characteristic overcomes a major disadvantage of ODBC –With ODBC, a vendor must create an ODBC driver for almost all DBMS features and functions in order to participate in ODBC at all

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/19 Copyright © 2004 Key Object-Oriented Concepts  An object-oriented programming object is an abstraction that is defined by its properties and methods –An abstraction is a generalization of something –A property specifies set of characteristics of an object –A method refers to actions that an object can perform –A collection is an object that contains a group of other objects

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/20 Copyright © 2004 OLE DB Goals  Create object interfaces for DBMS functionality pieces –Query, update, transaction management, etc.  Increase flexibility –Allow data consumers to use only the objects they need –Allow data providers to expose pieces of DBMS functionality –Providers can deliver functionality in multiple interfaces –Interfaces are standardized and extensible  Object interface over any type of data –Relational and non-relational database, ODBC or native, VSAM and other files, , etc.  Do not force data to be converted or moved from where it is

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/21 Copyright © 2004 OLE DB Basic Constructs  Data providers  Rowset interfaces  An interface is a set of objects and the properties and methods they expose in that interface –Objects may expose different properties and methods in different interfaces  An implementation is how an object accomplishes its tasks –Implementations are hidden from the outside world and may be changed without impacting the users of the objects

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/22 Copyright © 2004 OLE DB Data Providers  OLE DB has two types of data providers –Tabular data provider exposes data via rowsets Examples: DBMS, spreadsheets, ISAMs –Service provider is a transformer of data through OLE DB interfaces It is both a consumer and a provider of transformed data Examples: query processors, XML document creator

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/23 Copyright © 2004 Rowset Interfaces  A rowset is equivalent to a cursor  Basic rowset interfaces include –IRowSet Methods for sequential iteration through a rowset –IAccessor Methods for setting and determining bindings between rowset and client program variables –IColumnsInfo Methods for determining Information about the columns in the rowset

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/24 Copyright © 2004 ADO  ADO (Active Data Objects) characteristics –Simple object model for OLE DB data consumers –Can be used from VBScript, JScript, Visual Basic, Java, C#, C++ –Single Microsoft data access standard –Data access objects are the same for all types of OLE DB data

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/25 Copyright © 2004 ADO Object Model

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/26 Copyright © 2004 Connection Object  A connection object establishes a connection to a data provider and data source –Connections have an isolation mode  Once a connection is created, it can be used to create RecordSet and Command objects

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/27 Copyright © 2004 RecordSet Objects  RecordSet objects represent cursors –They have both CursorType and LockType properties –RecordSets can be created with SQL statements –The Fields collection of a RecordSet can be processed to individually manipulate fields –The Errors collection contains one or more error messages that result from an ADO operation.

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 12/28 Copyright © 2004 Command Object  The command object is used to execute stored parameterized queries or stored procedures –Input data can be sent to the correct ASP using the HTML FORM tag –Table updates are made using the RecordSet Update method

Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP