Databases Reference
In-Depth Information
service that handles the following workflow requires access to different data
sources:
1.
Retrieves an incoming Electronic Data Interchange (EDI) order
2.
Validates client information stored in an Oracle database
3.
Retrieves the customer number from the Oracle database
4.
Submits an order to a DB2 database using the customer number
5.
Sends a receipt to the client using EDI
Sequentially processing all the data involved in these steps can involve
tremendous overhead. Comparisons of or conversions between data in different
formats requires code to marshal the data from one format to another. Typically,
this code changes the data from the XML data model to the relational data model
and vice versa. Eventually, all data used by the service is marshaled to the XML
format to create an XML response to a Web Service call. Retrieving all this data
from disparate sources can require many network round trips and multiple
transformation layers to marshal the data.
Let's think about this differently. Most SOA architectures use XML-based
requests and responses. XQuery is a query language for XML. Some XQuery
products allow you to query data from XML documents or any data source that
can be viewed as XML such as relational databases. With this type of solution,
you can query almost any data source as though it were XML, regardless of how
the data is physically stored.
Just as SQL is a relational query language and Java is an object-oriented pro-
gramming language, XQuery is often thought of as a native XML programming
language. At the time of this writing, XQuery 1.0 is a recommended specification
of the W3C that you can find at www.w3.org/TR/xquery/. 1
The XQuery API for Java (XQJ) is designed to support the XQuery language,
just as the ODBC, JDBC, and ADO.NET APIs support the SQL query language.
The XQJ standard (JSR 225) is being developed under the Java Community
Process that you can find at www.jcp.org/en/jsr/detail?id=225. 2
Some databases, such as Oracle 11 g , have already incorporated support for
XQuery. There are also products on the market that provide an XQuery proces-
sor to optimize your access to both relational and XML data sources, as shown in
Figure 11-4.
1 “XQuery 1.0: An XML Query Language.” W3C. 02/02/2009 ( http://www.w3.org/TR/xquery/).
2 “JSR 225: XQuery API for JavaTM (XQJ).” Java Community Process. 02/02/2009 ( http://www.jcp.org/
en/jsr/detail?id=225).
Search WWH ::




Custom Search