|
|
|
| |
Menu |
|
|
| |
|
|
| |
|
|
|
|
 |
|
|
Total Tutorials: 1,109
|
|
|
|
| |
|
|
|
|
|
|
|
|
The widespread adoption of XML has profoundly altered the way that information is exchanged within and between enterprises. XML, an extensible, text-based markup language, describes data in a way that is both hardware- and software-independent. As such, it has become a standard of choice for a growing number of Web services and Service Oriented Architectures. With a vast amount of data being published in XML format by multiple sources, the need has arisen for an easy and efficient means of extracting and manipulating this information. XQuery has emerged as an ideal way to aggregate data from Web services, relational databases, and other applications that employ XML.
This XQuery tutorial explains XQuery's use as a report-generation technology, for aggregating data from multiple sources. The tutorial uses real-world data from a stock-quote Web service, and combining that information with historical company data stored in a relational database and presented as XML. In this tutorial, the historical data is being enhanced with live data about the current stock price, which is being retrieved via a Web-service call. Once the data is aggregated, it can be presented in any number of formats.
|
|
Type: XQuery
#Views: 626
Category: Tutorial
|
|
|
|
|
The XQuery language is designed specifically for XML programming and data integration, and programmers are more productive using XQuery for these tasks. However, many enterprise applications are built on the Java platform, and often require functionality not found in XQuery; for instance, many XML programs need to use the Web Services functionality of J2EE. On the Java platform, XML is accessed and manipulated as a DOM tree, a SAX stream, or as a StAX stream.
The XQuery API for Java, currently under development as JSR 225, lets programmers have the best of both worlds, using XQuery for XML programming and data integration, with full access to the J2SE and J2EE platforms. XQJ allows a Java program to connect to XML data sources, prepare and issue XQueries, and process the results as XML. This functionality is similar to that of JDBC® Java API for SQL, but the query language for XQJ is XQuery.
This article shows how XQJ is used to issue XQueries and obtain results. Next, it shows how XQJ can be used to query DOM trees, perform joins between XML and relational sources, obtain results using StAX, and issue prepared XQueries (similar to JDBC's prepared statements). Finally, we show four complete, working XQJ programs, including one that uses StAX to handle output. These programs are based on the Early Draft Review of JSR-225, released in May 2004. Code examples were tested with a pre-release version of DataDirect XQuery™, which implements XQuery and XQJ.
|
|
Type: XQuery
#Views: 655
Category: Tutorial
|
|
|
|
|
|
|
|
|
|
|
|
Featured
Products |
Advertise on
XMLPitstop
|
Our
Sponsors |
Advertise on
XMLPitstop
|
Partners |
|
Friends |
|
Statistics |
2,846 Total Members
31 members(last 30 days)
8 members(last 7 days)
0 members(today)
1,905 Total Discussions
6 Posts(last 30 days)
3 Posts(last 7 days)
0 Posts(today)
47,487 Total Blog Posts
0 Blogs(last 30 days)
0 Blogs(last 7 days)
0 Blogs(today)
8,699 Newsgroup Posts
0 Posts(last 30 days)
0 Posts(last 7 days)
0 Posts(today)
14,050 Total Resources
2 Resources(last 30 days)
1 Resources(last 7 days)
0 Resources(today)
|
|
|
| |
|