java.sql
Class QueryObjectFactory

java.lang.Object
  extended by java.sql.QueryObjectFactory

public class QueryObjectFactory
extends Object

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.

Since:
1.6

Constructor Summary
QueryObjectFactory()
           
 
Method Summary
static
<T> T
createDefaultQueryObject(Class<T> ifc, Connection con)
          Creates a concrete implementation of a Query interface using the Java SE QueryObjectGenerator implementation.
static
<T> T
createDefaultQueryObject(Class<T> ifc, javax.sql.DataSource ds)
          Creates a concrete implementation of a Query interface using the Java SE QueryObjectGenerator implementation.
static
<T> T
createQueryObject(Class<T> ifc, Connection con)
          Creates a concrete implementation of a Query interface using the JDBC driver's QueryObjectGenerator implementation.
static
<T> T
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

QueryObjectFactory

public QueryObjectFactory()
Method Detail

createDefaultQueryObject

public static <T> T createDefaultQueryObject(Class<T> ifc,
                                             javax.sql.DataSource ds)
                                  throws SQLException
Creates a concrete implementation of a Query interface using the Java SE QueryObjectGenerator implementation.

Parameters:
ifc - The Query interface that will be created
ds - The DataSource that will be used when invoking methods that accesss the data source
Returns:
A concrete implementation of a Query interface
Throws:
SQLException - if a database access error occurs.
Since:
1.6

createDefaultQueryObject

public static <T> T createDefaultQueryObject(Class<T> ifc,
                                             Connection con)
                                  throws SQLException
Creates a concrete implementation of a Query interface using the Java SE QueryObjectGenerator implementation.

Parameters:
ifc - The Query interface that will be created
con - The Connection that will be used when invoking methods that accesss the data source
Returns:
A concrete implementation of a Query interface
Throws:
SQLException - if a database access error occurs.
Since:
1.6

createQueryObject

public static <T> T createQueryObject(Class<T> ifc,
                                      javax.sql.DataSource ds)
                           throws SQLException
Creates a concrete implementation of a Query interface using the JDBC driver's 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.

Parameters:
ifc - The Query interface that will be created
ds - The DataSource that will be used when invoking methods that accesss the data source
Returns:
A concrete implementation of a Query interface
Throws:
SQLException - if a database access error occurs.
Since:
1.6

createQueryObject

public static <T> T createQueryObject(Class<T> ifc,
                                      Connection con)
                           throws SQLException
Creates a concrete implementation of a Query interface using the JDBC driver's 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.

Parameters:
ifc - The Query interface that will be created
con - The Connection that will be used when invoking methods that accesss the data source
Returns:
A concrete implementation of a Query interface
Throws:
SQLException - if a database access error occurs.
Since:
1.6