Package Summary  Overview Summary


javax.sql.rowset
Class RowSetFactory

java.lang.Object
  extended by javax.sql.rowset.RowSetFactory


Direct Known Subclasses:
RowSetFactoryImpl

public abstract class RowSetFactory
extends java.lang.Object

A factory API that enables applications to configure and obtain different types of RowSet implementations.

Example:

 RowSetFactory aFactory = RowSetFactory.newInstance();
 CachedRowSet crs = aFactory.createCachedRowSet();
 ...
 RowSetFactory rsf = RowSetFactory.newInstance("com.sun.rowset.RowSetFactoryImpl", null);
 WebRowSet wrs = rsf.createWebRowSet();
 

Tracing of this class may be enabled by setting the System property javax.sql.rowset.RowSetFactory.debug.

Since:
1.7


Constructor Summary
protected RowSetFactory()
           
 
Method Summary
abstract  CachedRowSet createCachedRowSet()
          Creates a new instance of a CachedRowSet.
abstract  FilteredRowSet createFilteredRowSet()
          Creates a new instance of a FilteredRowSet.
abstract  JdbcRowSet createJdbcRowSet()
          Creates a new instance of a JdbcRowSet.
abstract  JoinRowSet createJoinRowSet()
          Creates a new instance of a JoinRowSet.
abstract  WebRowSet createWebRowSet()
          Creates a new instance of a WebRowSet.
static RowSetFactorynewInstance()
          Creates a new instance of a RowSetFactory implementation.
static RowSetFactorynewInstance(java.lang.String factoryClassName, java.lang.ClassLoader cl)
          Creates a new instance of a RowSetFactory from the specified factory class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowSetFactory

protected RowSetFactory()
Method Detail

createCachedRowSet

public abstract CachedRowSetcreateCachedRowSet()
                                         throws SQLException

Creates a new instance of a CachedRowSet.

Returns:
A new instance of a CachedRowSet.
Throws:
SQLException - if a CachedRowSet cannot be created.
Since:
1.7

createFilteredRowSet

public abstract FilteredRowSetcreateFilteredRowSet()
                                             throws SQLException

Creates a new instance of a FilteredRowSet.

Returns:
A new instance of a FilteredRowSet.
Throws:
SQLException - if a FilteredRowSet cannot be created.
Since:
1.7

createJdbcRowSet

public abstract JdbcRowSetcreateJdbcRowSet()
                                     throws SQLException

Creates a new instance of a JdbcRowSet.

Returns:
A new instance of a JdbcRowSet.
Throws:
SQLException - if a JdbcRowSet cannot be created.
Since:
1.7

createJoinRowSet

public abstract JoinRowSetcreateJoinRowSet()
                                     throws SQLException

Creates a new instance of a JoinRowSet.

Returns:
A new instance of a JoinRowSet.
Throws:
SQLException - if a JoinRowSet cannot be created.
Since:
1.7

createWebRowSet

public abstract WebRowSetcreateWebRowSet()
                                   throws SQLException

Creates a new instance of a WebRowSet.

Returns:
A new instance of a WebRowSet.
Throws:
SQLException - if a WebRowSet cannot be created.
Since:
1.7

newInstance

public static RowSetFactorynewInstance()
                                 throws SQLException

Creates a new instance of a RowSetFactory implementation. This method uses the following look up order to determine the RowSetFactory implementation class to load:

Once an application has obtained a reference to a RowSetFactory, it can use the factory to obtain RowSet instances.

Returns:
New instance of a RowSetFactory
Throws:
SQLException - if the default factory class cannot be loaded, instantiated. The cause will be set to actual Exception
Since:
1.7
See Also:
ServiceLoader

newInstance

public static RowSetFactorynewInstance(java.lang.String factoryClassName,
                                        java.lang.ClassLoader cl)
                                 throws SQLException

Creates a new instance of a RowSetFactory from the specified factory class name. This function is useful when there are multiple providers in the classpath. It gives more control to the application as it can specify which provider should be loaded.

Once an application has obtained a reference to a RowSetFactory it can use the factory to obtain RowSet instances.

Parameters:
factoryClassName - fully qualified factory class name that provides an implementation of javax.sql.rowset.RowSetFactory.
cl - ClassLoader used to load the factory class. If null current Thread's context classLoader is used to load the factory class.
Returns:
New instance of a RowSetFactory
Throws:
SQLException - if factoryClassName is null, or the factory class cannot be loaded, instantiated.
Since:
1.7
See Also:
newInstance()


Java is a trademark or registered trademark of Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A All Rights Reserved.