java.lang.Objectjava.sql.QueryObjectFactory
public class QueryObjectFactory
This is a utility class which provides access to the implementation of QueryObjectGenerator
that is provided with Java SE.
This class can also be used with JDBC drivers which do not provide QueryObjectGenerator
implementations.
| Constructor Summary | |
|---|---|
QueryObjectFactory()
|
|
| Method Summary | ||
|---|---|---|
static
|
createDefaultQueryObject(Class<T> ifc,
Connection con)
Creates a concrete implementation of a Query interface using the Java SE QueryObjectGenerator
implementation. |
|
static
|
createDefaultQueryObject(Class<T> ifc,
javax.sql.DataSource ds)
Creates a concrete implementation of a Query interface using the Java SE QueryObjectGenerator
implementation. |
|
static
|
createQueryObject(Class<T> ifc,
Connection con)
Creates a concrete implementation of a Query interface using the JDBC driver's QueryObjectGenerator
implementation. |
|
static
|
createQueryObject(Class<T> ifc,
javax.sql.DataSource ds)
Creates a concrete implementation of a Query interface using the JDBC driver's QueryObjectGenerator
implementation. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryObjectFactory()
| Method Detail |
|---|
public static <T> T createDefaultQueryObject(Class<T> ifc,
javax.sql.DataSource ds)
throws SQLException
QueryObjectGenerator
implementation.
ifc - The Query interface that will be createdds - The DataSource that will be used when invoking methods that accesss
the data source
SQLException - if a database access error occurs.
public static <T> T createDefaultQueryObject(Class<T> ifc,
Connection con)
throws SQLException
QueryObjectGenerator
implementation.
ifc - The Query interface that will be createdcon - The Connection that will be used when invoking methods that accesss
the data source
SQLException - if a database access error occurs.
public static <T> T createQueryObject(Class<T> ifc,
javax.sql.DataSource ds)
throws SQLException
QueryObjectGenerator
implementation. This method will attempt to invoke DataSource.createQueryObject() and if the
method does not exist on the DataSource, createDefaultQueryObject will be invoked
to create the concrete implementation of a Query interface.
ifc - The Query interface that will be createdds - The DataSource that will be used when invoking methods that accesss
the data source
SQLException - if a database access error occurs.
public static <T> T createQueryObject(Class<T> ifc,
Connection con)
throws SQLException
QueryObjectGenerator
implementation. This method will attempt to invoke Connection.createQueryObject() and if the
method does not exist on the Connection, createDefaultQueryObject will be invoked
to create the concrete implementation of a Query interface.
ifc - The Query interface that will be createdcon - The Connection that will be used when invoking methods that accesss
the data source
SQLException - if a database access error occurs.