- java.lang.Object
-
- javax.sql.rowset.RowSetProvider
-
public class RowSetProvider extends Object
A factory API that enables applications to obtain aRowSetFactory
implementation that can be used to create different types ofRowSet
implementations.Example:
RowSetFactory aFactory = RowSetProvider.newFactory(); CachedRowSet crs = aFactory.createCachedRowSet(); ... RowSetFactory rsf = RowSetProvider.newFactory("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
to any value butfalse
.- Since:
- 1.7
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
RowSetProvider()
-
Method Summary
Methods Modifier and Type Method and Description static RowSetFactory
newFactory()
Creates a new instance of aRowSetFactory
implementation.static RowSetFactory
newFactory(String factoryClassName, ClassLoader cl)
Creates a new instance of aRowSetFactory
from the specified factory class name.
-
-
-
Method Detail
-
newFactory
public static RowSetFactory newFactory() throws SQLException
Creates a new instance of a
RowSetFactory
implementation. This method uses the following look up order to determine theRowSetFactory
implementation class to load:-
The System property
javax.sql.rowset.RowSetFactory
. For example:- -Djavax.sql.rowset.RowSetFactory=com.sun.rowset.RowSetFactoryImpl
-
The
ServiceLoader
API. TheServiceLoader
API will look for a class name in the fileMETA-INF/services/javax.sql.rowset.RowSetFactory
in jars available to the runtime. For example, to have the the RowSetFactory implementationcom.sun.rowset.RowSetFactoryImpl
loaded, the entry inMETA-INF/services/javax.sql.rowset.RowSetFactory
would be:-
com.sun.rowset.RowSetFactoryImpl
-
-
Platform default
RowSetFactory
instance.
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
-
The System property
-
newFactory
public static RowSetFactory newFactory(String factoryClassName, 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 ofjavax.sql.rowset.RowSetFactory
.cl
-ClassLoader
used to load the factory class. Ifnull
currentThread
's context classLoader is used to load the factory class.- Returns:
- New instance of a
RowSetFactory
- Throws:
SQLException
- iffactoryClassName
isnull
, or the factory class cannot be loaded, instantiated.- Since:
- 1.7
- See Also:
newFactory()
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/sql/rowset/RowSetProvider.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.