import static org.firebirdsql.ds.ReflectionHelper.findMethod;
Wrapper for prepared statements. This invocation handler notifies statement
manager about closing prepared statement.
- Roman Rokytskyy
Create instance of this class.
statement SQL statement to which prepared statement corresponds
preparedStatement prepared statement corresponding to statement.
owner instance of
that created prepared
Invoke method on a specified proxy. Here we check if
is a method
. If yes, we notify owner
that this prepared statement was closed.
proxy proxy on which method is invoked.
method instance of
describing method being invoked.
args array with arguments.
- result of method invokation.
java.lang.Throwable if invoked method threw an exception.
Check if method call is correct. If method was declared in
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).
String message = "Statemenet has illegal state because it "+
"does not have any associated connection at this time. " +
"Usually this means that Statement.getConnection() " +
"method was called on a closed statement that currently " +
"lives in a statement pool. ";
message += "See the attached exception " +
"for the information where the object was closed.";