Skip Headers

Oracle9i XML Database Developer's Guide - Oracle XML DB
Release 2 (9.2)

Part Number A96620-02
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 Go to next page
View PDF

17
Oracle XML DB Resource API for Java

This chapter describes the Oracle XML DB Resource API for Java. It contains the following sections:

Introducing Oracle XML DB Resource API for Java

See Also:

Using Oracle XML DB Resource API for Java

Oracle XML DB Resource API for Java operates as follows:

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).

Parameters for Oracle XML DB Resource API for Java

Table 17-1 lists the parameters supported by Oracle XML DB Resource API for Java.

Table 17-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 "oracle.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 17-1 Resource JDBC: Using SQL To Determine Purchase Order Properties

Here is an example using SQL, that provides the power of SQL SELECT potentially using criteria other than path name to find 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();