org.firebirdsql.pool
Class PooledPreparedStatementHandler
java.lang.Object
org.firebirdsql.pool.PooledPreparedStatementHandler
- InvocationHandler
public class PooledPreparedStatementHandler
extends java.lang.Object
implements InvocationHandler
Wrapper for prepared statements. This invocation handler notifies statement
manager about closing prepared statement.
checkCorrectness
protected void checkCorrectness(Method method)
throws SQLException
Check if method call is correct. If method was declared in
PreparedStatement
class and there is no connection proxy
associated with this statement (i.e. statement in in pool), exception is
thrown (this situation usually happens if somebody tries to call method
on prepared statement after it has been closed).
method
- method to check.
findMethod
public static Method findMethod(Class clazz,
String name,
Class[] params)
handleForceClose
protected void handleForceClose()
throws SQLException
handleIsCached
protected boolean handleIsCached()
throws SQLException
handleStatementClose
protected void handleStatementClose(String statement,
Object proxy)
throws SQLException
Handle Statement.close()
call.
statement
- SQL statement corresponding to the wrapped prepared
statement.proxy
- dynamic proxy wrapping prepared statement.
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
Invoke method on a specified proxy. Here we check if method
is a method PreparedStatement.close()
. If yes, we notify owner
that this prepared statement was closed.
proxy
- proxy on which method is invoked.method
- instance of Method
describing method being invoked.args
- array with arguments.
- result of method invokation.
Copyright B) 2001 David Jencks and other authors. All rights reserved.