Class TrapException

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    public class TrapException
    extends JdbcInterceptor
    Interceptor that traps any unhandled exception types and throws an exception that has been declared by the method called, or throw a SQLException if it is declared. If the caught exception is not declared, and the method doesn't throw SQLException, then this interceptor will throw a RuntimeException
    • Constructor Detail

      • TrapException

        public TrapException()
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Description copied from class: JdbcInterceptor
        Gets invoked each time an operation on Connection is invoked.
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Overrides:
        invoke in class JdbcInterceptor
        Throws:
        java.lang.Throwable
      • isDeclaredException

        public boolean isDeclaredException​(java.lang.reflect.Method m,
                                           java.lang.Class<?> clazz)
      • reset

        public void reset​(ConnectionPool parent,
                          PooledConnection con)
        no-op for this interceptor. no state is stored.
        Specified by:
        reset in class JdbcInterceptor
        Parameters:
        parent - - the connection pool owning the connection
        con - - the pooled connection