Oracle8i Application Developer's Guide - XML
Release 3 (8.1.7)

Part Number A86030-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

Oracle XML Components and General FAQs, 8 of 18


Oracle XSQL Page Processor and Servlet

XSQL Servlet is a tool that processes SQL queries and outputs the result set as XML. This processor is implemented as a Java servlet and takes as its input an XML file containing embedded SQL queries. It uses XML Parser for Java, XML- SQL Utility, and Oracle XSL Transformation (XSLT) Engine to perform many of its operations.

You can use XSQL Servlet to perform the following tasks:

Servlet Engines that Support XSQL Servlet

XSQL Servlet has been tested with the following servlet engines:

JavaServer Pages (JSP) Platforms that Support XSQL Servlet

JavaServer Pages can use <jsp:forward> and/or <jsp:include> to collaborate with XSQL Pages as part of an application. The following JSP platforms have been tested to support XSQL Servlet:

In general, it should work with the following:

XSQL Servlet is a tool that processes SQL queries and outputs the result set as XML. This processor is implemented as a Java servlet and takes as its input an XML file containing embedded SQL queries. It uses XML Parser for Java and XML-SQL Utility to perform many of its operations.

Figure 3-4 shows how data flows from a client, to the servlet, and back to the client. The sequence of events is as follows:

  1. The user enters a URL through a browser, which is interpreted and passed to the XSQL Servlet through a Java Web Server. The URL contains the name of the target XSQL file (.xsql) and optionally, parameters, such as values and an XSL stylesheet name. Alternatively, the user can invoke the XSQL Servlet from the command line, bypassing the browser and Java web server.

  2. The servlet passes the XSQL file to the XML Parser for Java, which parses the XML and creates an API for accessing the XML contents.

  3. The page processor component of the servlet uses the API to pass XML parameters and SQL statements (found between <query></query> tags) to XML-SQL Utility. The page processor also passes any XSL processing statements to the XSLT Processor.

  4. XML-SQL Utility sends the SQL queries to the underlying Oracle8i database, which returns the query results to the utility.

  5. XML-SQL Utility returns the query results to the XSLT Processor as XML formatted text. Results are embedded in the XML file in the same location as the original <query> tags.

  6. If desired, the query results and any other XML data are transformed by the XSLT Processor using a specified XSL stylesheet. The data can be transformed to HTML or any other format defined by the stylesheet. The XSLT Processor can selectively apply different stylesheets based on the type of client that made the original URL request. This HTTP_USER_AGENT information is obtained from the client through an HTTP request.

  7. The XSLT Processor passes the completed document back to the client browser for presentation to the user.

Figure 3-4 Oracle XSQL Page Processor and Servlet Functional Diagram



Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index