Users of the XQJ API can bind Java values to XQuery expressions, preventing code injection attacks.
It had some big technology backers such as Oracle,[3][4][5][6] IBM,[5][6] BEA Systems,[7] Software AG,[8] Intel, Nokia and DataDirect.
The XQJ classes are contained in the Java package javax.xml.xquery There is no (visible) activity to create a version of XQJ that provides support for XQuery 3.0 or 3.1, for example by providing Java bindings for additions to the data model such as functions, arrays, or maps.
Atomic XQuery items can be easily cast to Java primitives via XQItemAccessor methods such as getByte() and getFloat().
Also XQuery items and sequences can be serialized to DOM Node, SAX ContentHandler, StAX XMLStreamReader and the generic IO Reader and InputStream classes.
The following example illustrates creating a connection to an XML Database, submitting an XQuery expression, then processing the results in Java.
The following table illustrates the default mapping rules for when binding Java values to external variables in XQuery expressions.