Database Reference
In-Depth Information
XQResultSequence
As a result of executing an XQExpression or XQPreparedExpression , a result
sequence is generated that may be iterated over to retrieve results from the
server.
Examples
The source code of a simple example of using the xqj.net XQJ API from Java to query
the database is included in the folder chapters/integration/xqj-client of the book-code
Git repository (see “Getting the Source Code” on page 15 ).
To compile the example, enter the xqj-client folder and run mvn package .
Query example. You can then execute the QueryApp example like so:
java -jar xqj-client-query/target/xqj-client-query-1.0-example.jar
This shows the available arguments for using the QueryApp.
A complete example of using the application might look like the following, which
would find the family names of all of the people in all of the documents in the collec‐
tion /db/my-new-collection in the database:
java -jar xqj-client-query/target/xqj-client-query-1.0-example.jar localhost 8080
"for \$person in //person return \$person/family" /db/my-new-collection admin
On non-Windows platforms, you must escape the $ character used
in XQuery for variables when sending the query in a command line
from the terminal by prefixing with a \ character. If you do not
escape this symbol, the shell interpreter will try to interpret them as
environment variables, which will result in an invalid XQuery and
therefore an XQJException : XQJQS001 - Invalid XQuery syntax
response from the XQJ API.
Deprecated Remote APIs
From eXist 2.0 onward, several APIs that were available in previous versions are now
deprecated. These APIs have been deprecated either because the eXist developers felt
that they were infrequently used by the community, because they had been replaced
by more modern APIs, or because the contributors of these APIs no longer supported
them. We'll look at a few of them here.
Atom Servlet
The Atom Servlet in eXist provides an implementation of the IETF Atom syndication
format and publishing protocol. The Atom Servlet was originally written in Java, but
Search WWH ::




Custom Search