Package org.apache.commons.dbutils
Class ProxyFactory
java.lang.Object
org.apache.commons.dbutils.ProxyFactory
Creates proxy implementations of JDBC interfaces. This avoids
incompatibilities between the JDBC 2 and JDBC 3 interfaces. This class is
thread safe.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected constructor for ProxyFactory subclasses to use. -
Method Summary
Modifier and TypeMethodDescriptioncreateCallableStatement(InvocationHandler handler) Creates a new proxyCallableStatementobject.createConnection(InvocationHandler handler) Creates a new proxyConnectionobject.createDriver(InvocationHandler handler) Creates a new proxyDriverobject.createPreparedStatement(InvocationHandler handler) Creates a new proxyPreparedStatementobject.createResultSet(InvocationHandler handler) Creates a new proxyResultSetobject.createResultSetMetaData(InvocationHandler handler) Creates a new proxyResultSetMetaDataobject.createStatement(InvocationHandler handler) Creates a new proxyStatementobject.static ProxyFactoryinstance()Returns the Singleton instance of this class.<T> TnewProxyInstance(Class<T> type, InvocationHandler handler) Convenience method to generate a single-interface proxy using the handler's classloader
-
Constructor Details
-
ProxyFactory
protected ProxyFactory()Protected constructor for ProxyFactory subclasses to use.
-
-
Method Details
-
instance
Returns the Singleton instance of this class.- Returns:
- singleton instance
-
createCallableStatement
Creates a new proxyCallableStatementobject.- Parameters:
handler- The handler that intercepts/overrides method calls.- Returns:
- proxied CallableStatement
-
createConnection
Creates a new proxyConnectionobject.- Parameters:
handler- The handler that intercepts/overrides method calls.- Returns:
- proxied Connection
-
createDriver
Creates a new proxyDriverobject.- Parameters:
handler- The handler that intercepts/overrides method calls.- Returns:
- proxied Driver
-
createPreparedStatement
Creates a new proxyPreparedStatementobject.- Parameters:
handler- The handler that intercepts/overrides method calls.- Returns:
- proxied PreparedStatement
-
createResultSet
Creates a new proxyResultSetobject.- Parameters:
handler- The handler that intercepts/overrides method calls.- Returns:
- proxied ResultSet
-
createResultSetMetaData
Creates a new proxyResultSetMetaDataobject.- Parameters:
handler- The handler that intercepts/overrides method calls.- Returns:
- proxied ResultSetMetaData
-
createStatement
Creates a new proxyStatementobject.- Parameters:
handler- The handler that intercepts/overrides method calls.- Returns:
- proxied Statement
-
newProxyInstance
Convenience method to generate a single-interface proxy using the handler's classloader- Type Parameters:
T- The type of object to proxy- Parameters:
type- The type of object to proxyhandler- The handler that intercepts/overrides method calls.- Returns:
- proxied object
-