Enterprise Information Portals   Table of contents   Indexes   Data Maintenance on the Web Made Easy with XML Templates

 Muench, Steve  
 Oracle Corporation 
 Redwood Shores 
 USA 
 
Steve Muench
 Consulting Product Manager & XML Evangelist
Oracle Corporation
  500 Oracle Parkway Box 2op12 Redwood Shores (California)  USA (94065)
Email: smuench@oracle.com Web site:http://technet.oracle.com/tech/xml
 Biography
 Steve Muench is Oracle's lead technical evangelist for XML and is the Consulting Product Manager on the "Business Components for Java" development team. In his ten years at Oracle, he's been a key figure in the support, development, and evangelism of Oracle's application development tools and database. He's been a driving force in helping Oracle development teams from the database server, to application server, to tools, to packaged applications weave XML sensibly into their development plans. He is currently writing a book on Oracle8i XML Applications for O'Reilly.
 

Abstract

 The potent combination of XML for portable Internet data exchange, Java for portable application logic, and Enterprise relational databases for mission-critical data management is the technology platform of choice for the Internet Applications running the world's e-Businesses. This paper discusses how relational databases and XML fit together and describes Oracle's approach to providing this technology "stack" to developers.
 

Introduction

 Internet-empowered consumers and businesses are driving a skyrocketing demand for access to information.
 
  •  Consumers – seduced by the convenience of paying bills, booking flights, tracking stocks, checking prices, and getting everything from gifts to groceries online – are hungry for more.
  •  Businesses – compelled by the lower costs of online "outsourcing" and the ability to inquire, day or night, "What’s the status?" – are ramping up to reap the rewards.
  •  "Infomediaries" – inspired by the boundless creative opportunities to aggregate information and broker services between consumers and businesses– are popping up left and right.
 Leading sites on the Web are racing to capitalize on this demand by providing more access to more information in a more customized way than ever before. It is not a coincidence thatall of these leading sites from Amazon.com to Yahoo! run their information-hungry e-Businesses on enterprise-scale relational databases.
 The reason is simple. Today's enterprise relational databases offer business-critical features like flexible data access, lightning-fast query speeds over "galaxies" of data, and integrated support for multimedia data and data warehousing to support personalization on a massive scale. They offer the reliability, availability, and scalability that the modern "dot-com" cannot live and breathe for a moment without.
 However, even with full-featured, high-performance relational databases at the heart of their Internet architectures, best-of-breed e-Commerce sites claim their key development challenges continue to be integration, integration, and integration...
 
  •  Integration with back-end ERP and CRM systems from multiple vendors,
  •  Integration with systems from partners in their supply chain, and
  •  Integration with Data Warehouses for unprecedented levels of personalization.
 Leading relational database vendors realized early how powerful a technology XML would be in providing solutions for these kinds of information and application integration challenges and have been working at a feverish pace to tightly integrate XML support into their database platforms.
 

How XML and Relational Databases Fit Together

 Relational databases offer two fundamental ways to handle XML-based information, depending on whether the information is business data or document content:
 

XML Data and Documents in Relational Databases

 
  •  Business Data needs to be stored, queried, analyzed, and manipulated efficiently by many different kinds of applications.
     This kind of information is optimally storedinternally in one or more relational tables.
  •  Document Content , both text and multimedia, needs to searched in specialized ways specific to their media types and efficiently assembled to produce dynamic documents.
     This kind of information is optimally storedinternally in searchable content "chunks" that can range in size from a single paragraph or frame of video, to entire documents or videos.
 When new XML-based messages or documents are stored in the database, they are easily stored in their optimalinternal form. Existing and future internal applications can work with the information in the most efficient way possible. When information must "leave" the database, for sharing with partners or other applications, the appropriate view of data and document content specific to the task at hand can be delivered as an integrated XML document.
 In many real-world applications the worlds of documents and data come together:
 
  •  Business Data needs to be delivered as an integrated part of business documents, and
  •  Document Content has metadata that needs to be queried, analyzed, and manipulated without necessarily accessing the actual media content "chunks".
 So most applications will make use of both the data-centric and document-centric approaches to managing their business information inside their databases. The leading enterprise relational databases offer seamless integration of both approaches.
 As an example, consider an insurance claim. It mixes highly structured data like settlement payment information with structured markup like an insurance adjuster's damage report.
 
 Insurance Claim Mixes Structure Data and Structured Document Fragments
 Gazing over a vast "galaxy" of millions of insurance claims in a data warehouse to answer a pertinent business question like:
 "How much money has Jim Cox approved to date in settlement payments for arson-related fire claims? "
 requires querying through the millions of rows of claim settlement information as well as through the document fragments for each insurance claim's<DamageReport> . Queries like this are easy with today's XML-enabled enterprise relational databases like Oracle8i .
 

Powerful Views of Related Information Are a Perfect Match for XML

 One of the fundamental benefits of relational databases is the concept ofviews . Database views allow developers to present data in any number of "logical" combinations, hiding any details of their underlying physical storage. Views effectively transform the structure of one or more underlying tables into a more useful or more appropriate structure for the demands of a specific application. Since views can be based on other views, this mechanism offers an extremely powerful, layered mechanism for presenting information in virtually any way that is appropriate for the task at hand.
 Consider a simple set of relational database views that present the information model of a hospital:
 
 Simple Relational Model for a Hospital
 When views of information are linked withother views of related information, they quite naturally form "trees" or "graphs" of related data. When we represent database information XML, the related views above provide the foundation for many different tree-structured XML documents.
 
  •  A<PATIENT> profile, with related information about the list of<VISIT> she has had, with which <DOCTOR> s at what<FACILITY> s,
  •  A<DOCTOR> profile, with related information about the list of<VISIT> s he has made, with which <PATIENT> s.
  •  A<STATE> profile, with related information about the list of<CITY> s in the state, and what medical <FACILITY> s exist in each city.
 The list could clearly go on. The key point is that the tables and views in a relational database, together with the links between the data represented by foreign keys, represent many differentvirtual XML documents full of related information, depending on your desired point of view.
 

A Closer Look at the Oracle8i Platform for XML-Based Internet Applications

 Oracle’s XML strategy is to deliver the best platform for developers to productively build and cost-effectively deploy reliable and scalable Internet applications. Leveraging years of research and development in scalable object/relational database technology, Oracle8i offers Internet application developers a compelling blend of:
 
  •  Enterprise object/relational database features,
  •  A built-in, industrial-strength Java virtual machine, and
  •  Significant enhancements for working with XML Business Data and Document Content.
  •  Industry-leading performance, reliability, and scalability.
 Below we briefly highlight the features of the platform of interest to application developers building XML-enabled Internet applications:
 
  •  XML-Enabled Object Views Over Relational Data
     Object Views allow information in relational tables to be materialized on the fly as a richly-structured XML views of any information in the database. They allow you to present multiple, logical XML views of the same information easily. They support SQL99 "object query" path expressions for retrieving only relevant substructures using the full power of the structured query language, and of course XML information can be easily inserted into the database through the Object Views.
  •  Oracle Intermedia XML Search
     Automatically index and search XML Documents and Document Fragments of any size up to 4 Gigabytes each. Powerful XML document searching including hierarchical element containership, doctype discrimination, and searching on XML attributes. XML document searches can be used in combination with standard SQL query predicates as well as in conjunction with other powerful lexical and full-text searching options.
  •  Oracle8i JServer Java Virtual Machine
     Built from the ground up on top of the Oracle Multithreaded Server architecture, this fully-compliant Java 1.2 virtual machine shares the memory address space of the data server. This allows mission-critical, data-intensive Java and XML-processing code to run within-memory data access speeds using standard JDBC interfaces. Natively compile Java bytecodes to double or triple the performance of server-side Java, with linear scalability to thousands of concurrent users. Supports native CORBA and EJB standards as well as Java Stored Procedures for easily integrating Java with SQL and PL/SQL.
  •  Oracle XML Parsers
     Oracle's family of XML parsers include redistributable implementations in C, C++, PL/SQL and Java for the full range of platforms on which Oracle runs. In recent conformance tests published on XML.COM, Oracle's parser was ranked in the top two validating parsers for its conformance to the XML 1.0 specification. All of the parser's support both SAX and DOM interfaces. The second-generation "v2" parser implementation provides integrated support for XPath and incremental XSLT transformation of document nodes. For additional performance, the parser comes natively compiled into the Oracle8i 8.1.6 database.
  •  Oracle XSL Transformation Engine
     Providing full support for W3C XSL Transformations, the Oracle XSLT engine enables standards-based transformation of XML information inside and outside the database on any platform. It supports Java extensibility and for additional performance comes natively compiled into the Oracle8i 8.1.6 database.
  •  Oracle XML SQL Utilities
     Core Java class libraries for automatically and dynamically rendering the results of arbitrary SQL queries into canonical XML. Includes support for queries over richly-structured user-defined object types and object views. Features automatic "XML Insert" of canonically-structured XML into any table, view, object table or object view. By combining with XSLT transformation, virtually any XML document can be automatically inserted into the database.
  •  Oracle XSQL Page Processor and Servlet
     Easily build dynamic XML "datapages" from the results of one or more SQL queries and serve the results over the Web as XML datagrams or HTML pages using server-side XSLT transformation. Easily receive XML posted to your web server and insert it into your database. Makes use of the Oracle XML Parser, Oracle XSL Transformation Engine, and the Oracle XML SQL Utilities to get the job done.
  •  Oracle JDeveloper
     A tightly-integrated and productive environment for building, deploying, and debugging applications leveraging Java and XML on the Oracle platform. Easily work in Java 1.1 or 1.2 with CORBA, EJB, and Java Stored Procedures leveraging Oracle's XML/XSLT components to build powerful multi-tier applications. Create and debug Java Servlets that serve XML information in a snap. Future releases will have integrated support for working directly with XML messages and designing XSL Transformations.
  •  Oracle Business Components for Java
     BC4J is Java- and XML-based application framework for encapsulating business logic into reusable libraries of Java components and reusing the business logic through flexible, SQL-based views of information. By linking BC4J View Objects, developers can easily provide readable and writeable XML-based "Business Object Views" that fully support encapsulated business rules for use in message-based e-Commerce applications.
  •  Oracle XML Class Generator
     Produce a set of JavaBeans corresponding to the elements for any XML DTD to assist in programmatically creating valid document instances from dynamic data.
  •  Oracle Technology Network
     Up to the minute information on all Oracle technology is always a click away at http://technet.oracle.com. The site contains free software downloads, scads of sample code, and on-line discussion/support forums for getting technical questions answered.
 

Simple Examples of Using Oracle8i and XML

 Here we offer a simple example of the power of combining SQL, XML, and XSLT for producing dynamic information for Internet Applications. One of the easiest ways to understand the power of this combination is to download and try out the Oracle XSQL Page Processor and Servlet. This makes it trivially easy for SQL-savvy developers to quickly produce an XML "datapages" full of any information in their databases.
 Let's say a developer building a dynamic web site wants to drive all the content from her database. She already has tables called SITE_CATEGORY andSITE_ENTRY that contain information about the major content categories of the site and the individual story entries in each category, respectively.
 She builds an XSQL Page describing the particular queries that present just the information her website requires by filling in an XML template with<query> tags as show below...
 
 Source Code of the "XSQL" Page Driving the "Do You XML?" Website
 If she requests the XSQL page through her browser, she'll see the raw XML output coming from the database:
 
 Raw XML Output of the XSQL "Datapage"
 After building an XSLT Stylesheet to format the data as XML and associating it with the XSQL page using an<?xml-stylesheet?> processing instruction, the next time she requests the page it gets transformed in the server before being returned. What the browser sees is pure HTML, dynamically rendered from database data and formatted using XSLT without writing code...
 
 Database-Driven Website Using an XSQL Page and XSL Stylesheet
 Of course with the same ease, she can dynamically serve XML-based datagrams in any format based right off any data in her database as well.
 For inbound XML, the XSQL Page Processor facilitates declaratively specifying the XSL Transform to use to transform an XML-based message into the canonical format the database can accept for automatic insertion into any table, view, object table, or object view.
 

Conclusion

 With its integrated Java & XML support to complement its industry-leading portability, reliability, and scalability, Oracle8i gives developers a leg up in satisfying the increasing demand for access to information. Oracle8i and XML help companies create strategic advantage by dramatically simplifying the acquisition, integration, repurposing, and exchange of information over the Internet. Once that XML-based information is safely stored in an Oracle database, it can be searched and mined and processed and presented in familiar, powerful ways.
 Most leading Internet companies already have Oracle at the heart of information management architecture for the Web, so the Oracle8i /XML combination is a natural extension to the way they do business today. It provides a compelling technology platform to further profit from opportunities where Electronic Commerce, Data Warehousing, Content Management, and Back Office Integration flow together.

Enterprise Information Portals   Table of contents   Indexes   Data Maintenance on the Web Made Easy with XML Templates