org.apache.commons.dbutils
Class ProxyFactory

java.lang.Object
  extended byorg.apache.commons.dbutils.ProxyFactory

public class ProxyFactory
extends Object

Creates proxy implementations of JDBC interfaces. This avoids incompatibilities between the JDBC 2 and JDBC 3 interfaces. This class is thread safe.

Author:
David Graham
See Also:
Proxy, InvocationHandler

Field Summary
private static Class[] callableStatementClass
          Class[] for CallableStatement interface.
private static Class[] connectionClass
          Class[] for Connection interface.
private static Class[] driverClass
          Class[] for Driver interface.
private static ProxyFactory instance
          The Singleton instance of this class.
private static Class[] metaClass
          Class[] for ResultSetMetaData interface.
private static Class[] preparedStatementClass
          Class[] for PreparedStatement interface.
private static Class[] resultSetClass
          Class[] for ResultSet interface.
private static Class[] statementClass
          Class[] for Statement interface.
 
Constructor Summary
protected ProxyFactory()
          Protected constructor for ProxyFactory subclasses to use.
 
Method Summary
 CallableStatement createCallableStatement(InvocationHandler handler)
          Creates a new proxy CallableStatement object.
 Connection createConnection(InvocationHandler handler)
          Creates a new proxy Connection object.
 Driver createDriver(InvocationHandler handler)
          Creates a new proxy Driver object.
 PreparedStatement createPreparedStatement(InvocationHandler handler)
          Creates a new proxy PreparedStatement object.
 ResultSet createResultSet(InvocationHandler handler)
          Creates a new proxy ResultSet object.
 ResultSetMetaData createResultSetMetaData(InvocationHandler handler)
          Creates a new proxy ResultSetMetaData object.
 Statement createStatement(InvocationHandler handler)
          Creates a new proxy Statement object.
static ProxyFactory instance()
          Returns the Singleton instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

callableStatementClass

private static final Class[] callableStatementClass
Class[] for CallableStatement interface.


connectionClass

private static final Class[] connectionClass
Class[] for Connection interface.


driverClass

private static final Class[] driverClass
Class[] for Driver interface.


instance

private static final ProxyFactory instance
The Singleton instance of this class.


metaClass

private static final Class[] metaClass
Class[] for ResultSetMetaData interface.


preparedStatementClass

private static final Class[] preparedStatementClass
Class[] for PreparedStatement interface.


resultSetClass

private static final Class[] resultSetClass
Class[] for ResultSet interface.


statementClass

private static final Class[] statementClass
Class[] for Statement interface.

Constructor Detail

ProxyFactory

protected ProxyFactory()
Protected constructor for ProxyFactory subclasses to use.

Method Detail

instance

public static ProxyFactory instance()
Returns the Singleton instance of this class.


createCallableStatement

public CallableStatement createCallableStatement(InvocationHandler handler)
Creates a new proxy CallableStatement object.

Parameters:
handler - The handler that intercepts/overrides method calls.

createConnection

public Connection createConnection(InvocationHandler handler)
Creates a new proxy Connection object.

Parameters:
handler - The handler that intercepts/overrides method calls.

createDriver

public Driver createDriver(InvocationHandler handler)
Creates a new proxy Driver object.

Parameters:
handler - The handler that intercepts/overrides method calls.

createPreparedStatement

public PreparedStatement createPreparedStatement(InvocationHandler handler)
Creates a new proxy PreparedStatement object.

Parameters:
handler - The handler that intercepts/overrides method calls.

createResultSet

public ResultSet createResultSet(InvocationHandler handler)
Creates a new proxy ResultSet object.

Parameters:
handler - The handler that intercepts/overrides method calls.

createResultSetMetaData

public ResultSetMetaData createResultSetMetaData(InvocationHandler handler)
Creates a new proxy ResultSetMetaData object.

Parameters:
handler - The handler that intercepts/overrides method calls.

createStatement

public Statement createStatement(InvocationHandler handler)
Creates a new proxy Statement object.

Parameters:
handler - The handler that intercepts/overrides method calls.