Download presentation
Presentation is loading. Please wait.
Published byPamela Green Modified over 9 years ago
1
IBM DB2 UD & XML Extender IBM DB2 UD & XML Extender AstroGrid Project Registry Group Pedro Contreras 14 August 2003
2
Overview Installation & Requirement XML Extender How DB2 and XML Extender work together Storages and access methods XML column method XML collection method Document Access Definition (DAD) file Working with XML Extender Planning how to store the document Steps to enable XML extender for XML document Mapping a DAD file: an example
3
Installation & Requirement Can be installed as part of DB2 Universal Database 8.1 Or can be installed later Requirement - DB2ADM authority - Bind the XML Extender to your DB2 UDB database
4
XML Extender - Stores and access XML documents - Generates XML documents from an existent Database - Inserts row into relational tables from XML documents - It provides new data types, functions and store procedure to manage XML data in DB2
5
How DB2 and XML Extender work together - Administration tools to help with the integration of XML Data with DB2 - XML Extender wizard - dxxadm command line - XML Extender Store procedures - Store and access methods for XML data within the database - DTD (or schemas) used to validate XML data - A mapping file called Document Access Definition (DAD), used to map XML documents into relational data
6
Storages and access methods XML Extenders provides two different methods for integrating XML documents with DB2 data structures: XML columns and XML collections. These methods are different but can be used in the same application. XML column method It stores intact XML documents in DB2. This method works well for archiving documents. The documents are inserted into columns enabled for XML that can be updated, retrieved and searched. XML collection method This method map XML document structure to DB2 tables. So, it can either compose XML documents from existent DB2 data, or decompose XML documents into DB2 tables. This method is good when the contents of XML documents are frequently updated
7
Document Access Definition (DAD) file It defines the locations of important files like DTD or schemas, and specifies how the XML document structure is related to DB2 data. It also defines the access and storage method used in the application. In short, the DAD file is an XML document that maps the XML structure to the DB2 table.
8
Planning how to store the document - Understand the structure of XML document - Identify the XML user-defined type in which you will store the XML document - Identify XML elements that will be frequently search. The content of these can be store in side tables and indexed to improve performance Steps to enable XML extender for XML documents - Choose one method of mapping: XML column or XML collection - Enable the DB to work with XML files: “dxxadm enable_db db_name” - Store the DTD into DB2: can be done by command line or the GUI - Create a DAD file - Create and enable the columns to store the XML document Working with XML Extender
9
... XML Document DAD file DB2 Mapping a DAD file
10
serviceMetadataConcept interfaceMetadatacapabilitiesMetadata serviceRestriction serviceStandardUri serviceStandardUrl serviceRestrictionSpatial serviceMaxNrows serviceMaxImageSize serviceMSR serviceHTTPResultType serviceHTTPResult serviceInterfaceUrl serviceBaseUrl service.xml Mapping a DAD file
11
serviceMetadataConcept interfaceMetadatacapabilitiesMetadata serviceRestriction serviceStandardUri serviceStandardUrl serviceRestrictionSpatial serviceMaxNrows serviceMaxImageSize serviceMSR serviceHTTPResultType serviceHTTPResult serviceInterfaceUrl serviceBaseUrl StandardUri StandardUr MSR MaxImageSize httpResultType interfaceUrl baseUrl MaxNrows service.xml mapped to DB Name of column in DB2 table Mapping a DAD file
12
XML Extender Administrator LaunchPad COM.ibm.db2.jdbc.net.DB2.Driver (network connection) jdbd:db2://[host]:[port]//[database] (network connection)
13
XML Extender Administrator LaunchPad Create DAD file automatically
14
Creating a DAD file with XML Administrator Wizard
17
D:\AstroGrid\xml\db2Test\service.dtd YES <column name="maxNrows" type="varchar()" path="/serviceMetadataConcept/capabilitiesMetadataserviceRestriction/serviceMaxNrows" multi_occurrence="NO"/> <column name="restrictionSpatial" type="varchar()" path="/serviceMetadataConcept/capabilitiesMetadata/serviceRestriction/serviceRestrictionSpatial" multi_occurrence="NO"/> <column name="MSR" type="varchar()" path="/serviceMetadataConcept/capabilitiesMetadata/serviceRestriction/serviceRestrictionSpatial/serviceMSR" multi_occurrence="NO"/>. Creating a DAD file with XML Administrator Wizard
18
DB2 Enabling XML capabilities in DB2... XML Document DAD file DB2 Next step is enable DB2 to work with XML documents: depends of the method (column or collection) how to do it. Could be command line or DB2 XML Extender Wizard.
19
XML Column XML Collection SQL mapping uses SQL select statement to defines DB2 tables and condition RDB_node mapping uses X-Path based database node Compose XML DB2 to XML Decompose XML XML to DB2 Store procedure: dxxGenXML() dxxGenClob() dxxRetrieveXML() dxxRetrieveXMLClob() dxxShredXML dxxInsertXML XML Extender methods
20
Next steps Map Schema files Use java and store procedure to decompose XML documents
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.