Skip Headers

Oracle® XML DB Developer's Guide
10g Release 1 (10.1)

Part Number B10790-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

22 Java Access to Repository Data Using Resource API for Java

This chapter describes the Oracle XML DB resource application program interface (API) for Java.

This chapter contains these topics:

Introducing Oracle XML DB Resource API for Java

Using Oracle XML DB Resource API for Java

With Oracle XML DB resource API for Java you use JDBC to access Oracle XML DB resource views for retrieving and modifying database resources.

Additionally, you can perform these operations:

Oracle XML DB resource API for Java includes a set of sub-interfaces that indicate resource type Versioning information WebDAV.

The API includes interfaces for objects such as workspaces, branches, and baselines (as defined by the WebDAV versioning specification).

Oracle XML DB Resource API for Java Parameters

Table 22-1 lists the parameters supported by Oracle XML DB resource API for Java.

Table 22-1 Oracle XML DB Resource API for Java: Parameters

Parameter Name Description
PROVIDER_URL The start path from which objects are to be returned.
INITIAL_CONTEXT_FACTORY The context factory to be used to generating contexts – always DBMS_XDB.spi.XDBContextFactory.
XDB_RESOURCE_TYPE Determines what data is returned to the application by default when a path name is resolved:
  • Resource: A resource class will be returned.

  • XMLType: The contents of the resource will be returned.

In this release, Oracle XML DB has implemented only the javax.naming package. Oracle XML DB has an extension to this package, an extension to the lookup() method. The extension (an overload) also takes a Boolean (indicating that a row lock should be grabbed) to indicate a lookup FOR UPDATE and a String with an XPath to define a fragment of the document to load immediately (rather than relying on the lazy manifest facility).


Oracle XML DB Resource API for Java: Examples

Example 22-1 Resource JDBC: Using SQL To Determine Purchase Order Properties

This examples uses a SQL SELECT and criteria other than path name to retrieve the XMLType object:

PreparedStatement pst = con.prepareStatement(
"SELECT r.RESOLVE_PATH('/companies/oracle') FROM XDB$RESOURCE r");

pst.executeQuery();
XMLType po = (XMLType)pst.getObject(1);
Document podoc = (Document) po.getDOM();