XQJ Tutorial

XQuery in Java

This tutorial teaches you how to execute XQuery and process the results from within a Java program via the XQuery API for Java™ standard.

Tutorial Prerequisite 1: Basic familiarity with Java, how to compile and run code.
Tutorial Prerequisite 2: Basic familiarity with XQuery.
1. Setting up your environment
Runs through setting up an XQuery/XML Datasource and how to connect with it from Java via the XQJ API.
2. Executing a simple XQuery
Create a connection to an XQuery/XML Datasource and perform a simple XQuery expression and process the results.
3. Binding Java variables to XQuery expressions
Covers binding Java Objects and primitives to XQuery expressions as XQuery variables.
4. Understanding the XDM Model within XQJ
Discusses Creating XQItems and XQSequences, binding variables to XQuery expressions and making sure the data meets the requirements of various XML Schema datatypes
5. Processing massive amounts of XML Data with XQuery
Discusses processing huge amounts of XML data with XQuery by streaming XML content directly to the XQuery processor
6. Processing XQuery Results with StAX (Streaming API for XML)
Discusses processing huge amounts of XML data sent from the XQuery processor with StAX and SAX APIs.