Database Reference
In-Depth Information
Example 13-13. Accessing a remote XML:DB collection
Collection
collection
=
DatabaseManager
.
getCollection
(
"xmldb:exist://localhost:8080/exist/xmlrpc/db"
,
"admin"
,
""
);
Resource
s
A
Resource
in the XML:DB API maps onto a document in the eXist database.
eXist's implementation of the XML:DB API allows you to work with both its
XML and binary documents. See
Example 13-14
.
Example 13-14. Retrieving a Resource from an XML:DB remote collection
Resource
resource
=
collection
.
getResource
(
"some-document.xml"
);
Service
s
A
Service
in the XML:DB API allows you to perform extended operations
against the database. The XML:DB API provides services for collection manage‐
ment, XPath/XQuery, and XUpdate services. In addition, eXist provides some
eXist-specific XML:DB services for user management, database instance manage‐
ment, and index queries. You retrieve a
Service
from a connection to a
Collec
tion
by specifying its name and version. See
Example 13-15
and
Table 13-7
.
Example 13-15. Obtaining a query service from an XML:DB remote collection
XPathQueryService
queryService
=
collection
.
getService
(
"XPathQueryService"
,
"1.0"
);
Table 13-7. eXist XML:DB services
Service name(s)
Java class (org.exist.xmldb)
Description
XML:DB XPath Service. In
eXist, XQuery is also offered.
XPathQueryService
XQueryService
RemoteXPathQueryService
XML:DB Collection
Management Service.
CollectionManagementService
CollectionManager
RemoteCollectionManagementSer
vice
XML:DB XUpdate Service.
XUpdateQueryService
RemoteXUpdateQueryService
eXist User Management
Service extension for
XML:DB.
UserManagementService
RemoteUserManagementService
Search WWH ::
Custom Search