APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.rowset.providers

public final Class RIXMLProvider

extends SyncProvider
Class Inheritance
Imports
com.sun.rowset.JdbcRowSetResourceBundle, java.io.IOException, java.sql.*, javax.sql.*, javax.sql.rowset.spi.*

A reference implementation of a JDBC RowSet synchronization provider with the ability to read and write rowsets in well formed XML using the standard WebRowSet schema.

1.0 Background

This synchronization provider is registered with the SyncFactory by default as the com.sun.rowset.providers.RIXMLProvider.

A WebRowSet object uses an RIXMLProvider implementation to read an XML data source or to write itself in XML format using the WebRowSet XML schema definition available at

    http://xmlns.jcp.org/xml/ns//jdbc/webrowset.xsd
The RIXMLProvider implementation has a synchronization level of GRADE_NONE, which means that it does no checking at all for conflicts. It simply writes a WebRowSet object to a file.

2.0 Usage

A WebRowSet implementation is created with an RIXMLProvider by default.
    WebRowSet wrs = new FooWebRowSetImpl();
The SyncFactory always provides an instance of RIOptimisticProvider when no provider is specified, but the implementation of the default constructor for WebRowSet sets the provider to be the RIXMLProvider implementation. Therefore, the following line of code is executed behind the scenes as part of the implementation of the default constructor.
    wrs.setSyncProvider("com.sun.rowset.providers.RIXMLProvider");
See the standard RowSet reference implementations in the com.sun.rowset package for more details.
Author
Jonathan Bruce
See Also
javax.sql.rowset.spi.SyncProvider, javax.sql.rowset.spi.SyncProviderException, javax.sql.rowset.spi.SyncFactory, javax.sql.rowset.spi.SyncFactoryException

Field Summary

Modifier and TypeField and Description
private String
providerID

The unique provider identifier.

private JdbcRowSetResourceBundle
private String
vendorName

The vendor name of this SyncProvider implementation.

private String
versionNumber

The version number of this SyncProvider implementation.

private XmlReader
private XmlWriter
Inherited from javax.sql.rowset.spi.SyncProvider:
DATASOURCE_DB_LOCKDATASOURCE_NO_LOCKDATASOURCE_ROW_LOCKDATASOURCE_TABLE_LOCKGRADE_CHECK_ALL_AT_COMMITGRADE_CHECK_MODIFIED_AT_COMMITGRADE_LOCK_WHEN_LOADEDGRADE_LOCK_WHEN_MODIFIEDGRADE_NONENONUPDATABLE_VIEW_SYNCUPDATABLE_VIEW_SYNC

Constructor Summary

AccessConstructor and Description
public
RIXMLProvider()

This provider is available to all JDBC RowSet implementations as the default persistence provider.

Method Summary

Modifier and TypeMethod and Description
public int
getDataSourceLock()

Implements abstract javax.sql.rowset.spi.SyncProvider.getDataSourceLock.

Returns the default DATASOURCE_LOCK behavior of this reader

public int

Returns:

the SyncProvider synchronization grade of this provider; must be one of the following constants:
         SyncProvider.GRADE_NONE,
         SyncProvider.GRADE_MODIFIED_AT_COMMIT,
         SyncProvider.GRADE_CHECK_ALL_AT_COMMIT,
         SyncProvider.GRADE_LOCK_WHEN_MODIFIED,
         SyncProvider.GRADE_LOCK_WHEN_LOADED
      
getProviderGrade
()

Implements abstract javax.sql.rowset.spi.SyncProvider.getProviderGrade.

Returns the SyncProvider grade of syncrhonization that RowSet object instances can expect when using this implementation.

public String

Returns:

a String object with the fully specified class name of this RIOptimisticProvider implementation
getProviderID
()

Implements abstract javax.sql.rowset.spi.SyncProvider.getProviderID.

Returns "javax.sql.rowset.providers.RIXMLProvider", which is the fully qualified class name of this provider implementation.

public RowSetReader
getRowSetReader()

Implements abstract javax.sql.rowset.spi.SyncProvider.getRowSetReader.

Returns a null object as RowSetWriter objects are not returned by this SyncProvider

public RowSetWriter
getRowSetWriter()

Implements abstract javax.sql.rowset.spi.SyncProvider.getRowSetWriter.

Returns a null object as RowSetWriters are not returned by this SyncProvider

public String

Returns:

the String detailing the vendor name of this SyncProvider
getVendor
()

Implements abstract javax.sql.rowset.spi.SyncProvider.getVendor.

Returns the vendor name of the Reference Implementation Optimistic Synchronization Provider

public String

Returns:

the String detailing the version number of this SyncProvider
getVersion
()

Implements abstract javax.sql.rowset.spi.SyncProvider.getVersion.

Returns the release version ID of the Reference Implementation Optimistic Synchronization Provider.

public XmlReader

Returns:

the XmlReader object for this SyncProvider
getXmlReader
()

Retrieves the reader that this WebRowSet object will call when its readXml method is called.

public XmlWriter

Returns:

the XmlWriter for this SyncProvider
getXmlWriter
()

Retrieves the writer that this WebRowSet object will call when its writeXml method is called.

public void
setDataSourceLock(int lock)

Implements abstract javax.sql.rowset.spi.SyncProvider.setDataSourceLock.

Throws an unsupported operation exception as this method does function with non-locking XML data sources.

public void
setXmlReader(XmlReader reader)

Sets this WebRowSet object's reader to the given XmlReader object.

public void
setXmlWriter(XmlWriter writer)

Sets this WebRowSet object's writer to the given XmlWriter object.

public int
supportsUpdatableView()

Implements abstract javax.sql.rowset.spi.SyncProvider.supportsUpdatableView.

Returns the default UPDATABLE_VIEW behavior of this reader

Field Detail

providerIDback to summary
private String providerID

The unique provider identifier.

resBundleback to summary
private JdbcRowSetResourceBundle resBundle
vendorNameback to summary
private String vendorName

The vendor name of this SyncProvider implementation.

versionNumberback to summary
private String versionNumber

The version number of this SyncProvider implementation.

xmlReaderback to summary
private XmlReader xmlReader
xmlWriterback to summary
private XmlWriter xmlWriter

Constructor Detail

RIXMLProviderback to summary
public RIXMLProvider()

This provider is available to all JDBC RowSet implementations as the default persistence provider.

Method Detail

getDataSourceLockback to summary
public int getDataSourceLock() throws SyncProviderException

Implements abstract javax.sql.rowset.spi.SyncProvider.getDataSourceLock.

Returns the default DATASOURCE_LOCK behavior of this reader

Exceptions
SyncProviderException:

Doc from javax.sql.rowset.spi.SyncProvider.getDataSourceLock.

if an error occurs determining the data source locking level.

getProviderGradeback to summary
public int getProviderGrade()

Implements abstract javax.sql.rowset.spi.SyncProvider.getProviderGrade.

Returns the SyncProvider grade of syncrhonization that RowSet object instances can expect when using this implementation. As this implementation provides no synchronization facilities to the XML data source, the lowest grade is returned.

Returns:int

the SyncProvider synchronization grade of this provider; must be one of the following constants:

         SyncProvider.GRADE_NONE,
         SyncProvider.GRADE_MODIFIED_AT_COMMIT,
         SyncProvider.GRADE_CHECK_ALL_AT_COMMIT,
         SyncProvider.GRADE_LOCK_WHEN_MODIFIED,
         SyncProvider.GRADE_LOCK_WHEN_LOADED
      
getProviderIDback to summary
public String getProviderID()

Implements abstract javax.sql.rowset.spi.SyncProvider.getProviderID.

Returns "javax.sql.rowset.providers.RIXMLProvider", which is the fully qualified class name of this provider implementation.

Returns:String

a String object with the fully specified class name of this RIOptimisticProvider implementation

getRowSetReaderback to summary
public RowSetReader getRowSetReader()

Implements abstract javax.sql.rowset.spi.SyncProvider.getRowSetReader.

Returns a null object as RowSetWriter objects are not returned by this SyncProvider

getRowSetWriterback to summary
public RowSetWriter getRowSetWriter()

Implements abstract javax.sql.rowset.spi.SyncProvider.getRowSetWriter.

Returns a null object as RowSetWriters are not returned by this SyncProvider

getVendorback to summary
public String getVendor()

Implements abstract javax.sql.rowset.spi.SyncProvider.getVendor.

Returns the vendor name of the Reference Implementation Optimistic Synchronization Provider

Returns:String

the String detailing the vendor name of this SyncProvider

getVersionback to summary
public String getVersion()

Implements abstract javax.sql.rowset.spi.SyncProvider.getVersion.

Returns the release version ID of the Reference Implementation Optimistic Synchronization Provider.

Returns:String

the String detailing the version number of this SyncProvider

getXmlReaderback to summary
public XmlReader getXmlReader() throws SQLException

Retrieves the reader that this WebRowSet object will call when its readXml method is called.

Returns:XmlReader

the XmlReader object for this SyncProvider

Exceptions
SQLException:
if a database access error occurs
getXmlWriterback to summary
public XmlWriter getXmlWriter() throws SQLException

Retrieves the writer that this WebRowSet object will call when its writeXml method is called.

Returns:XmlWriter

the XmlWriter for this SyncProvider

Exceptions
SQLException:
if a database access error occurs
setDataSourceLockback to summary
public void setDataSourceLock(int lock) throws SyncProviderException

Implements abstract javax.sql.rowset.spi.SyncProvider.setDataSourceLock.

Throws an unsupported operation exception as this method does function with non-locking XML data sources.

Exceptions
SyncProviderException:

Doc from javax.sql.rowset.spi.SyncProvider.setDataSourceLock.

if an unsupported data source locking level is set.

setXmlReaderback to summary
public void setXmlReader(XmlReader reader) throws SQLException

Sets this WebRowSet object's reader to the given XmlReader object.

Exceptions
SQLException:
if a database access error occurs
setXmlWriterback to summary
public void setXmlWriter(XmlWriter writer) throws SQLException

Sets this WebRowSet object's writer to the given XmlWriter object.

Exceptions
SQLException:
if a database access error occurs
supportsUpdatableViewback to summary
public int supportsUpdatableView()

Implements abstract javax.sql.rowset.spi.SyncProvider.supportsUpdatableView.

Returns the default UPDATABLE_VIEW behavior of this reader