xml and database interface chao-hsien chu, ph.d. school of information sciences and technology the...

20
XML and Database Interface XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Upload: laurence-woods

Post on 29-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

XML and Database InterfaceXML and Database Interface

Chao-Hsien Chu, Ph.D.School of Information Sciences and Technology

The Pennsylvania State University

ODBCJDBC

ADO

DSO

Page 2: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Information

Information AgeInformation Age

Processing

Representation

Storage

Retrieval

Search Sharing

Management

Interchange

Page 3: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

IS there

such a creation ?

The Needs for Information InterchangeThe Needs for Information Interchange

Power Flexibility Simplicity Fault tolerance Scalability Interoperability Open standard Extensible Character-based Human-readable

Page 4: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

IS There Such a Creation?

Power Flexibility Simplicity Fault tolerance Scalability Interoperability Open standard Extensible Character-based Human-readable

HTML SGML XML

X XX X

? XX XX X

? ? ?? ? ?

X XX X X

X X

Criteria

Page 5: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Potential Applications of XMLPotential Applications of XML

Three-Tier Applications: Personalized Web Site On-Line Auction E Commerce Integration Content Acquisition Content Management Portals Publishing Databases Schemas management

Product Catalog E-commerce vocabulary Voice Transformation Mobile XML Voice Semantic Web Knowledge Navigation Metadata Description Topic maps Web services Infrastructure

Page 6: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Types of Information SharingTypes of Information Sharing

Information Posting /Publishing: Paper; CD-ROM; HTML/XHTML.

Data Integration: cXML (Ariba); tpaML (IBM); xCBL (ConmmerceOne); BizTalk (Microsoft); eCo (CommerceNet); eConcert (RosettaNet); ebXML (UN/CEFACT and OASIS).

Automated Trading: Electronic Data Interchange (EDI).

Page 7: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

XML for Information InterchangeXML for Information Interchange

CADPackage

WordProcessor

StatisticalProcessing

SpreadsheetPackage

XML

XSL

CSSXSL

CSS

Page 8: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

XSL

CSS

XML and Databases InterfaceXML and Databases Interface

XMLDocument

Print out

CD ROM

Web

WAP, etc.

RDBMS

OODBMS

OtherDBMSs

ADO

ODBC

JDBC

Page 9: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

XML Application InterfacesXML Application Interfaces

ADO: ActiveX Data Objects

DOM: Document Object Model

DSO: Data Source Object

ODBC: Open DataBase Connectivity

JDBC: Java DataBase Connectivity

CSS: Cascading Style Sheets

XSL – XML Stylesheet Language

Page 10: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Wireless IntegrationWireless Integration

XMLHTMLWML

ASP / Java

Page 11: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

XMLXSL

ASP / Java

Wireless IntegrationWireless Integration

Page 12: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Application Interfaces for XMLApplication Interfaces for XMLD

ocument

XML

Application

XML

Parser

XMLDOM

SAX

DOM: Document Object ModelSAX: Simple APIs for XML

Page 13: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

ADO

ODBC

JDBC

XSL

CSS

XML Application ConnectorsXML Application Connectors

XMLDocument

Print out

CD ROM

Web

WAP, etc.

RDBMS

OODBMS

OtherDBMSs

Applications

DOM SAX

Page 14: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

XML Information Retrieval MechanismXML Information Retrieval Mechanism

Application Programs / Browsers

DOM DSO CSS XSL

XMLDocuments

XML SQL

Data

SQL Server Oracle

Others

ADO

HTTP + SQL

ODBCJDBC

Page 15: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Example of ADOExample of ADO<%@language = "VBScript" %><% Response.ContentType ="text/xml" %><%dim cConn, rsData

'connects to the Access driver and Access database strProvider = "Driver={Microsoft Access Driver (*.mdb)};

DBQ="& server.mappath ("ROSTER.mdb")

'creates an instance of an Active Server componentset cConn = Server.CreateObject("ADODB.Connection")

'opens the connection to the data basecConn.Open strProvider

‘SQL QuerySet rsData = cConn.Execute("select * from roster")

%>

Page 16: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Example of ODBCExample of ODBC

<%@language = "VBScript" %><% Response.ContentType ="text/xml" %><%

dim cConn, rsData

‘Setup ODBC Connection (ROSTER ID:sa)

'creates an instance of an Active Server component set cConn = Server.CreateObject("ADODB.Connection")

'opens the connection to the data base cConn.Open "ROSTER","sa",""

‘SQL Query Set rsData = cConn.Execute("select * from roster")%>

Page 17: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

ODBC Example 2ODBC Example 2

<%@language = "VBScript" %>

<?xml version = "1.0" standalone = "no"?>

<?xml-stylesheet type="text/xsl" href="roster.xsl"?>

<Roster>

<%set conn=server.createobject ("adodb.connection")

conn.open "driver={Microsoft Access Driver (*.mdb)}; dbq="& server.mappath ("ROSTER.mdb")

set rs=conn.execute("select * from roster")

do while not rs.eof

%>

Page 18: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

ODBC Example 2ODBC Example 2<Student>

<Name> <%=rs("Name")%> </Name>

<Residence> <%=rs("Residence")%> </Residence>

<Age> <%=rs("Age")%> </Age>

<Telephone> <%=rs("Telephone")%> </Telephone>

</Student>

<%

rs.movenext

loop

%>

</Roster>

Page 19: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

DBMSs That Support XMLDBMSs That Support XML

Oracle 8 i (1999):http://technet.oracle.com/tech/xml

Microsoft SQL Server (2000):

http://support.microsoft.com/support/kb/articles/Q271/6/20.ASP

http://support.microsoft.com/support/kb/articles/Q271/7/80.ASP

Informix (2000):http://www.informix.com/xml/

XML Repository (2001):http://www.ozone-db.org/ozone_main.html

Page 20: XML and Database Interface Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University ODBC JDBC ADO DSO

Thank You?

Any Question?