public class java.sql
QueryObjectFactory


Show All Login
Java SE 6
  
Details
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.
since1.6


Constructors
public QueryObjectFactory()

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

ifcThe Query interface that will be created
dsThe DataSource that will be used when invoking methods that accesss the data source. The QueryObjectGenerator implementation will use this DataSource without any unwrapping or modications to create connections to the data source.
returnA concrete implementation of a Query interface
ThrowsSQLException: if a database access error occurs.
since1.6

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

ifcThe Query interface that will be created
conThe Connection that will be used when invoking methods that accesss the data source. The QueryObjectGenerator implementation will use this Connection without any unwrapping or modications to create statements from the data source.
returnA concrete implementation of a Query interface
ThrowsSQLException: if a database access error occurs.
since1.6

public static BaseQuery<T> createQueryObject(Class ifc, DataSource ds) throws SQLException Details
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.

ifcThe Query interface that will be created
dsThe DataSource that will be used when invoking methods that access the data source. The QueryObjectGenerator implementation will use this DataSource without any unwrapping or modications to create connections to the data source.
returnA concrete implementation of a Query interface
ThrowsSQLException: if a database access error occurs.
since1.6

public static BaseQuery<T> createQueryObject(Class ifc, Connection con) throws SQLException Details
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.

ifcThe Query interface that will be created
conThe Connection that will be used when invoking methods that access the data source. The QueryObjectGenerator implementation will use this Connection without any unwrapping or modications to create statements from the data source.
returnA concrete implementation of a Query interface
ThrowsSQLException: if a database access error occurs.
since1.6