Configuring the UriFactory Package to Handle DBUris
The UriFactory, as explained in "Creating Instances of UriType Objects with the UriFactory Package" on page 12-25, takes a URL and generates the appropriate subtypes of the UriType to handle the corresponding protocol. For HTTP URLs, UriFactory creates instances of the HttpUriType. But when you have an HTTP URL that represents a URI path, it is more efficient to store and process it as a DBUriType instance in the database. The DBUriType processing involves fewer layers of communication and potentially fewer character conversions.
After you install OraDBUriServlet, so that any URL such as http://machine-name/servlets/oradb/ gets handled by that servlet, you can configure the UriFactory to use that prefix and create instances of the DBUriType instead of HttpUriType:
begin
-- register a new handler for the dburi prefix.. urifactory.registerHandler('http://machine-name/servlets/oradb/ ,'SYS','DBUriTYPE', true,true);
end;
After you execute this block in your session, any UriFactory.getUri() call in that session automatically creates an instance of the DBUriType for those HTTP URLs that have the prefix.
See Also: Oracle9i XML API Reference - XDK and XDB for details of all functions in DBUriFactory package.
Post a comment