David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Eleven: The Web Server Environment.

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.
Database Processing Applications and Business Intelligence Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
1 Chapter 12 Working With Access 2000 on the Internet.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 25.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
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.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 236 Day 23.
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 236 Day 24.
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.
Database Processing Applications Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Getting Started with Microsoft SQL Server 2012 Express Edition Appendix A DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Getting Started with Web Servers, PHP, and the Eclipse PDT Appendix I DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
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
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 David M. Kroenke’s Chapter Twelve: ODBC Database Processing: Fundamentals,
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
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.
CPS120: Introduction to Computer Science The World Wide Web Nell Dale John Lewis.
IT420: Database Management and Organization XML 21 April 2006 Adina Crăiniceanu
Another PillowTalk Presentation  2004 Dynamic Systems, Inc. Introduction to XML for SOA Lee H. Burstein,
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 14 Networks, Multi-Tier Architectures, and XML.
Fundamentals of Database Chapter 7 Database Technologies.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
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.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
Fundamentals, Design, and Implementation, 9/e by David M. Kroenke BSA206 Database Management Systems Lecture 21: Databases and the Web Chapters 12, 13.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
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.
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.
+ Connecting to the Web Chapter 7. + Chapter Objectives Understand and be able to set up Web database processing Learn the basic concepts of Extensible.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
+ 1 XML eXtensible Markup Language. + 2 XML Lecture Adapted from the work of Dr. Praveen Madiraju of Marquette University.
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 Appendix I: Getting Started with Web Servers, PHP and the.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Database Processing Applications Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
Database application development 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall OBJECTIVES  Define terms  Explain three components.
1 LM 6 Database Applications Dr. Lei Li. Learning Objectives Explain three components of a client-server system Describe differences between a 2-tiered.
David M. Kroenke and David J. Auer Database Processing: Fundamentals, Design, and Implementation Chapter Ten: Managing Databases with SQL Server 2012,
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.
Database Processing Applications and Business Intelligence
Unit 4 Representing Web Data: XML
Database Connectivity and Web Technologies
Chapter 15 Database Connectivity and Web Technologies
Database Processing with XML
Database Processing Applications
Chapter 7 Representing Web Data: XML
Lecture 1: Multi-tier Architecture Overview
Getting Started Chapter One DATABASE CONCEPTS, 5th Edition
Database Processing: David M. Kroenke’s Chapter Twelve: Part One
Getting Started Chapter One DATABASE CONCEPTS, 4th Edition
Presentation transcript:

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Eleven: The Web Server Environment

Chapter Objectives To understand the nature and characteristics of the data environment that surrounds Internet technology database applications To learn the purpose, features, and facilities of ODBC To understand the characteristics of the Microsoft.NET Framework To understand the nature and goals of OLE DB To learn the characteristics and object model of ADO.NET KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 11-2

Chapter Objectives To understand the characteristics of JDBC and the four types of JDBC drivers To understand the nature of JSP and know the differences between JSP and ASP.NET To understand HTML and PHP To be able to construct Web database applications pages using PHP Understand the importance of XML Learn the elements of XML, including XML documents, document type declarations (DTDs), and XML stylesheets KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 11-3

Chapter Objectives Understand the role of XSLT in materializing XML documents Learn the basic concepts of XML Schema and understand their importance to database processing Understand XML documents Learn the basic concepts of using the SQL SELECT… FOR XML statement KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 11-4

Introduction Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers. Some of the important standards: –ODBC (Open Database Connectivity) is the early standard for relational databases. –OLE DB is Microsoft’s older object-oriented interface for relational and other databases. –The.NET Framework and ADO.NET are the current Microsoft “dot NET” data access standards providing easier access to data. –JBDC (Java Database Connectivity) is the Java “equivalent” of ODBC. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 11-5

Web Server Data Environment A Web server needs to publish applications that involve different data types. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 12-6

The Role of the ODBC Standard KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 11-7

ODBC The 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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 11-8

ODBC Architecture KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc. 11-9

ODBC Components ODBC consists of a data source, an application program, a driver manager, and a DBMS driver. A 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. An applications program issues requests to create a connection with a data source. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ODBC Components A driver manager determines the type of DBMS for a given ODBC data source and loads that driver in memory. A 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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ODBC Driver Types: ODBC Single-Tier Driver KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ODBC Driver Types: ODBC Multiple-Tier Driver KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Conformance Levels Levels of conformance balance the scope of the ODBC standard. There are 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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ODBC Conformance Levels KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

SQL Conformance Levels KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source III KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source IV KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source V KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source VI KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source VII KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating a System Data Source VIII KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

32-Bit versus 64-Bit ODBC I The ODBC Data Sources program we have been using is for the 64-bit version of the ODBC data sources administration program, and will create 64-bit ODBC data sources. These will only work as long as every component in the Web application program chain is a 64-bit program. But, if any component is a 32-bit program, the 64-bit ODBC data source will not work. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

32-Bit versus 64-Bit ODBC II In fact, when you are building the Web database applications in this chapter, if everything seems to be correctly done but the system still does not work, the most likely cause is a 32-bit program in the chain. To resolve this problem, you will need to use the 32-bit version of the ODBC Data Sources program. In Window 8 and Windows Server 2012, this is clearly labeled. In earlier versions of the Windows OS, it is located at C:\Windows\SysWOW64\odbcad32.exe. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

32-Bit versus 64-Bit ODBC III To resolve your Web database application problem, create a 32-bit ODBC data source using ODBC Administrator, and then revise your Web page code to use that ODBC data source. For more information on the programs in the Windows\SysWOW64 folder, see the Wikipedia article on WoW64 at en.wikipedia.org/wiki/WoW64. en.wikipedia.org/wiki/WoW64 KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

32-Bit versus 64-Bit ODBC IV In versions of the Windows OS prior to Windows 8 and Windows Server 2012, the two icons for the two versions appear as shown below. Note that although the program icons are the same, the program names are different. Data Source (ODBC ) is the 64-bit version, and ODBC Administrator is the 32-bit version. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The Microsoft.NET Framework KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The Role of OLE DB KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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 a 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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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 Provide object interfaces over any type of data: –Relational and non-relational database, ODBC or native, VSAM and other files, , and others. Do not force data to be converted or moved from where it is KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

OLE DB Basic Constructs There are data consumers and data providers: –Data consumers—users of OLE DB functionality –Data providers—sources of OLE DB functionality 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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

OLE DB Data Providers A rowset is equivalent to a cursor. OLE DB has two types of data providers: KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Rowset Interfaces KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The Role of ADO KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The Role of ADO.NET KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Data Provider A.NET data provider is a library of classes that provides ADO.NET services. Microsoft provides three data providers: –OLE DB data provider can be used to process any OLE DB-compliant data source. –SQL Server Client data provider is purpose-built for use with SQL Server. –Oracle Database Client data provider is purpose- built for use with Oracle Database. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Data Provider Components A connection object is similar to the ODBC’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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Data Provider Components KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The ADO.NET Object Model KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The ADO.NET Dataset Object Model KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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, nonproprietary means to process database views. –This is important for the processing of views with multiple multivalue paths. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

DataSet Disadvantages Because DataSet data is disconnected from the 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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

JDBC JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java. JDBC used to be a “nonacronym”—it didn’t stand for anything! Now it stands for Java DataBase Connectivity. JDBC drivers are available for most DBMS products: – KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

JDBC Driver Types KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Java Servlets and Applets Java programs are compiled into an operating system independent bytecode. Various operating systems use their own bytecode interpreters a.k.a. Java virtual machines. An applet is transmitted to a browser via HTTP and is invoked on the client workstation using the HTTP protocol. A servlet is a Java program that is invoked on the server to respond to HTTP requests. Type 3 and Type 4 drivers can be used for both applets and servlets. Type 2 drivers can be used only in servlets. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

JDBC Components KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Java Server Pages Java Server Pages (JSP) provide a means to create dynamic Webpages using HTML, XML, and Java. JSPs provide the capabilities of a full object- oriented language to the page developer. –Neither VBScript nor JavaScript can be used in a JSP. –JSPs are compiled into machine-independent bytecode. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

JSP Compilation Process KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

IIS Web Server I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

IIS Web Server II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

IIS Web Server III KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

index.html as Default Document KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

index.html KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

index.html in Microsoft Notepad KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

index.html in a Web Browser KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

index.html in Eclipse KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php in Eclipse KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php Initial HTML Code KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php Creating a Connection KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php Creating a RecordSet KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php Displaying the Results KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php Disconnecting from the Database KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtist.php in the Web Browser KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtistPDO.php I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtistPDO.php II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

ReadArtistPDO.php in the Web Browser KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

NewCustomerAndInterestsForm.html I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

NewCustomerAndInterestsForm.html II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The New Customer and Interests Form KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

InsertCustomerAndInterestsPDO.php l KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

InsertCustomerAndInterestsPDO.php lI KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

InsertCustomerAndInterestsPDO.php lII KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

The New Customer Acknowledgement Page KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Introduction to XML Database processing and document processing need each other. –Database processing needs document processing for expressing database views. –Document processing needs database processing for storing and manipulating data. As Internet usage increases, organizations want to make their Webpages more functional by displaying and updating data from organizational databases. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML XML, or Extensible Markup Language, was developed in the early 1990s: –XML is a subset of SGML, or Standard Generalized Markup Language. Today XML is a hybrid of document processing and database processing. –It provides a standardized yet customizable way to describe the content of documents. –XML documents can automatically be generated from database data and vice versa. SOAP is an XML-based standard protocol for sending messages of any type, using any protocol over the Internet. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML XML is used for describing, representing, and materializing database views. XML is better than HTML because: –It provides a clear separation between document structure, content, and materialization. –It is standardized but allows for extension by developers. –XML tags accurately represent the semantics of their data. Document Type Declarations (DTDs) and XML Schemas can be used to describe the content of XML documents. SQL Server, Oracle Database, and MySQL can produce XML documents from database data. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML DTD XML document consists of two sections: –Document Type Declaration (DTD) The DTD begins with DOCTYPE –Document data An XML document can be: –Type-valid if the document conforms to its DTD –Well-formed and not be type-valid, if It violates the structure of its DTD, or It has no DTD. A DTD may be stored externally so many documents can be validated against the same DTD. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XMLSpy The diagrams in the text and in the following slides were prepared with Altova’s XMLSpy. Altova’sXMLSpy There is a downloadable trial version available. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Document with Internal DTD KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Document with External DTD KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XSLT XSLT, or the Extensible Style Language may be used to materialize (transform) XML documents. –From XML documents into HTML or into XML in another format XSLT is a declarative transformation language: –Declarative: create rules, not procedure, to materialize the document –Transformational: transforms the input document into another document XSLT uses stylesheets to indicate how to transform the elements of the XML documents into another format. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

External DTD for CustomerList KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Document with Two Customers KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Example XSL Stylesheet KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Result in Web Browser KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Schema Document KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Schema KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Schema-Valid XML Document KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Flat Schemas: XML Schema Flat schemas have all elements at the same level: KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Flat Schemas: Graphical Representation of Schema KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Flat Schemas: Schema-Valid Document KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Structured Schemas: XML Schema Structured schemas have defined subgroups. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Structured Schemas: Graphical Representation of Schema KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Structured Schemas: Schema-Valid Document KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Global Elements: XML Schema with Global PhoneType KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Global Elements: PhoneType Global Element KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Global Elements: Graphical Representation of Schema KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Creating XML Documents from Database Data SQL Server, Oracle Database, and MySQL can generate XML documents from database data. 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 XMLSpy can generate schemas from such output. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

SQL FOR XML RAW I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

SQL FOR XML RAW II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

SQL FOR XML RAW III KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

SQL FOR XML AUTO, ELEMENTS I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

SQL FOR XML AUTO, ELEMENTS II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

SQL FOR XML AUTO, ELEMENTS III Partial Output KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

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. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Multivalue Paths: XML Schema with Two Multivalued Paths KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Multivalue Paths: Graphical View of the Schema KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Industries with XML Industry Standards I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

Industries with XML Industry Standards II KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Standards I KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Standards II 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 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 KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Standards III 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 KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

XML Standards IV 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 KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

David Kroenke and David Auer Database Processing Fundamentals, Design, and Implementation (13th Edition) End of Presentation: Chapter Eleven KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. KROENKE AND AUER - DATABASE PROCESSING, 13th Edition © 2014 Pearson Education, Inc