DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 236 Day 24.

Slides:



Advertisements
Similar presentations
XML: Extensible Markup Language
Advertisements

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 24.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
COMM 226 Database and content management Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University,
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 25.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Prentice Hall © COS 346 Day Agenda Capstone Progress report due Assignment 9 not corrected yet Assignment 10 posted (last one!!!) –Due.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 2 Introduction to Database Development.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 236 Day 23.
Prentice Hall © COS 346 Day Agenda Questions? Assignment 7 Corrected –4 A’s and 4 B’s Assignment 8 posted –Due April 6 Quiz 2 next class.
Getting Started (Excerpts) Chapter One DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 COS 346 Day 17.
Fundamentals, Design, and Implementation, 9/e Cos 346 Day 23.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 COS 346 Day 22.
Database Processing Applications Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Getting Started Chapter One DATABASE CONCEPTS, 7th Edition
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Chapter 14 Database Connectivity and Web Technologies
COS 381 Day 16. Agenda Assignment 4 posted Due April 1 There was no resubmits of Assignment Capstone Progress report Due March 24 Today we will discuss.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 David M. Kroenke’s Chapter Twelve: ODBC Database Processing: Fundamentals,
XML Fundementals XML vs.. HTML XML vs.. HTML XML Document (elements vs. attributes) XML Document (elements vs. attributes) XML and RDBMS XML and RDBMS.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Lecture 15 XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
XML in SQL Server Overview XML is a key part of any modern data environment It can be used to transmit data in a platform, application neutral form.
School of Computing and Management Sciences © Sheffield Hallam University To understand the Oracle XML notes you need to have an understanding of all these.
IT420: Database Management and Organization XML 21 April 2006 Adina Crăiniceanu
Session II Chapter 2 – Chapter 2 – XSLhttp://
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Database Technical Session By: Prof. Adarsh Patel.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 14 Networks, Multi-Tier Architectures, and XML.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 David M. Kroenke’s Chapter Thirteen: XML and ADO.NET Part Four Database.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 11-1 David M. Kroenke’s Chapter Eleven: Managing Databases with SQL Server.
Getting Started Chapter One DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Fundamentals, Design, and Implementation, 9/e by David M. Kroenke BSA206 Database Management Systems Lecture 21: Databases and the Web Chapters 12, 13.
ADO.NET. ADO.NET is a new, improved, and greatly expanded version of ADO that was developed for the Microsoft.NET initiative It incorporates all of the.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Jennifer Widom XML Data Introduction, Well-formed XML.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
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.
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
ADO ActiveX Data Object. ActiveX Data Objects (ADO) is Microsoft’s latest database object model. The goal of ADO is to allow VB developers to use a standard.
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
Martin Kruliš by Martin Kruliš (v1.1)1.
XML Tools (Chapter 4 of XML Book). What tools are needed for a complete XML application? n Fundamental components n Web infrasructure n XML development.
Introduction Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Eleven: The Web Server Environment.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML and Distributed Applications By Quddus Chong Presentation for CS551 – Fall 2001.
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
XML in Web Technologies
Database Processing with XML
Database Processing Applications
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
Chapter 10 ADO.
Database Applications
Getting Started Chapter One DATABASE CONCEPTS, 5th Edition
Database Processing: David M. Kroenke’s Chapter Twelve: Part One
Unit 6 - XML Transformations
Presentation transcript:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 236 Day 24

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-2 Agenda Assignment 10 Graded –5 A’s & 2 non-submits Assignment Average Posted –2 B’s, 4 C’s & 2 D Lowest Grade posted –1 C, 1 D, 2 F’s and 3 0’s Assignment 11 Posted –Due May 3 Assignment 12 Posted –Due May 9 Last Capstone Progress Reports Due Today Today we will discuss –XML and ADO.NET –Support-Files-Chap-13-XMLSupport-Files-Chap-13-XML

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-3 End of days? (subject to change) April 30 –DP Chap 13 –In class work May 3 –DP Chap 15 –Assignment 11 Due May 9 –Assignment 12 due –Quiz 3 –10 AM –Capstone presentations

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-4 XML resources %202006/cos381/cos_381_day_15.ppthttp://perleybrook.umfk.maine.edu/slides/spring %202006/cos381/cos_381_day_15.ppt %202006/cos381/cos_381_day_16.ppthttp://perleybrook.umfk.maine.edu/slides/spring %202006/cos381/cos_381_day_16.ppt

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-5 Overview

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-6 David M. Kroenke’s Chapter Thirteen: XML and ADO.NET Part Two Database Processing: Fundamentals, Design, and Implementation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-7 XML Schema XML Schema is a standard for describing the content of an XML document, i.e., defining custom vocabularies: –Documents that conform to an XML Schema are called schema- valid. –An XML document can be well-formed and be neither type-valid nor schema-valid. Unlike DTDs, XML Schema documents are themselves XML documents that can be validated against the schema maintained by W3C.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-8 XML Schema Document

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-9 Schema-Valid XML Document

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Elements and Attributes Schemas consist of elements and attributes: –Elements are used to carry data and attributes are used to carry metadata. Two types of elements: –Simple elements have a single data value. –ComplexType elements can have one or more simple or ComplexType elements. ComplexType elements can have attributes.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Flat Schemas: XML Schema Flat schemas have all elements at the same level:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Flat Schemas: Schema-Valid Document

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Flat Schemas: SGraphical Representation of Schema

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Structured Schemas: XML Schema Structured schemas have defined subgroups:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Structured Schemas: Schema-Valid Document

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Structured Schemas: Graphical Representation of Schema

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10 th Edition) End of Presentation: Chapter Thirteen Part Two

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Chapter Thirteen: XML and ADO.NET Part Three Database Processing: Fundamentals, Design, and Implementation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Global Elements To eliminate the definition duplication, elements can be declared globally, i.e., reside at the top level of the schema, and then reused.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Global Elements : XML Schema with Global PhoneType

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Global Elements : PhoneType Global Element

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Global Elements : Graphical Representation of Schema

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Creating XML Documents from Database Data Both Oracle and SQL Server can generate XML documents from database data. For Oracle — Use ome.html ome.html For SQL Server: –SELECT... FOR XML SELECT … FOR XML RAW — Places the values of columns as attributes in the XML document. SELECT … FOR XML AUTO, ELEMENTS — Places the values of columns as elements in the XML document. SELECT … FOR XML EXPLICIT — Allows the designation of which values of columns become attributes and elements. XML Spy can generate schemas from such output.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall XML Schema with Multivalue Paths Some views cannot be created in a single SQL statement because the construct requires two or more multivalued paths. XML does not have this limitation. An XML document can have as many multivalued paths as necessary.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Multivalue Paths: XML Schema with Two Multivalued Paths

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Multivalue Paths: Graphical View of the Schema

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Industries with XML Industry Standards

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Industries with XML Industry Standards (Continued)

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall XML Standards XML: Extensible Markup Language. XSL: XSLT Stylesheet. The document that provides the {match, action} pairs and other data for XSLT to use when transforming an XML document. XSLT: A program or process that applies XSLT Stylesheets to an XML document to produce a transformed XML document. XML schema: An XML-compliant language for constraining the structure of an XML document.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Additional XML Standards Xpath –A sublanguage within XSLT used to identify parts of an XML document to be transformed –Can also be used for calculations and string manipulation Xpointer –A standard for linking one document to another SAX: Simple API (application program interface) for XML. –An event-based parser that notifies a program when the elements of an XML document have been encountered during document parsing

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Additional XML Standards (Continued) DOM: Document Object Model. –An API that represents an XML document as a tree –Each node of the tree represents a piece of the XML document. –A program can directly access and manipulate a node of the DOM representation. XQuery –A standard for expressing database queries as XML documents –The structure of the query uses XPath facilities, and the result of the query is represented in an XML format. XML Namespaces: A standard for allocating terminology to defined collections –X:Name is interpreted as the element Name as defined in namespace X. –Useful for disambiguating terms

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10 th Edition) End of Presentation: Chapter Thirteen Part Three

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Chapter Thirteen: XML and ADO.NET Part Four Database Processing: Fundamentals, Design, and Implementation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET ADO.NET is a new, improved, and greatly expanded version of ADO that was developed for the Microsoft.NET initiative. It incorporates all of the functionality of ADO and OLE DB facilitates the transformation of XML documents to and from database constructs. It uses datasets, which are in-memory, fully- functioned, independent databases.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Role of ADO.NET ADO.NET serves as an intermediary between all types of.NET applications and the DBMS and database:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Data Provider A.NET data provider is a library of classes that provides ADO.NET services. Microsoft’s provides three data providers: –OLE DB data provider can be used to process any OLE DB-compliant data source. –SQLClient data provider is purpose-built for use with SQL Server. –OracleClient data provider is purpose-built for use with Oracle.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Data Provider Components A connection object is similar to the OBDC’s connection object. A command object is created on an established connection. A data reader provides read-only, forward-only, fast access to database data. An application can get and put data to and from the database using the command object. A dataset is an in-memory database that is disconnected from any regular database. –It distinguishes ADO.NET from the previous data access technology.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Data Provider Components (Continued)

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall The ADO.NET Dataset A dataset is an in-memory database that is disconnected from any regular database. Datasets can have: –Multiple tables, views, and relationships Tables may have surrogate key (auto increment columns), primary keys, and be declared as unique. –Referential integrity rules and actions –The equivalent of triggers Datasets may be constructed from several different databases and managed by different DBMS products.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Dataset Advantages Dataset contents and its XML schema can be easily formatted as an XML document. Also, XML schema documents can be read to create the structure of the dataset, and XML documents can be read to fill the dataset. Datasets are needed to provide a standardized, non- proprietary means to process database views. –This is important for the processing of views with multiple multi- value paths.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Dataset Disadvantages Because dataset data are disconnected from regular database, only optimistic locking can be used when updating the regular database with the dataset. In the case of conflict, either the dataset must be reprocessed or the data change must be forced onto the database, causing the lost update problem. Thus, datasets cannot be used for applications in which optimistic locking is problematical. –Instead, the ADO.NET command object should be used.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Creating the Dataset, Connection, and Data Adapter

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Using the Data Adapter to Fill the Dataset Tables

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Building Relationships

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Creating Referential Integrity Constraints

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Adding a Computed Column to a Data Table

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Using Data Grids – Filling the Grids with Dataset Tables

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Using Data Grids — Grid Display in Brower

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Chapter Thirteen: XML and ADO.NET Part Five Database Processing: Fundamentals, Design, and Implementation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Code to Generate an XML Document from the Dataset

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Portion of XML Document Generated from the Dataset

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Code to Generate an XML Schema from the Dataset

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Portion of XML Schema Generated from the Dataset

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Updating a Dataset and Database — Update Code

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Updating a Dataset and Database — Trigger-Like Event

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Updating a Dataset and Database Display RowVersion Code

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Updating a Dataset and Database Creating the Update Command

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Updating a Dataset and Database Log Showing Dataset Updates

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall ADO.NET: Updating a Dataset and Database Dataset Tables after Update

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10 th Edition) End of Presentation: Chapter Thirteen Part Five