@Override
  public Object invoke(
      final Object proxy, final Object underlying, final Method method, final Object[] args)
      throws Throwable {
    long startTime = System.currentTimeMillis();

    if (P6OutageOptions.getActiveInstance().getOutageDetection()) {
      P6OutageDetector.getInstance()
          .registerInvocation(
              this,
              startTime,
              "statement",
              preparedStatementInformation.getStatementQuery(),
              preparedStatementInformation.getSqlWithValues());
    }

    try {
      return method.invoke(underlying, args);
    } finally {
      if (P6OutageOptions.getActiveInstance().getOutageDetection()) {
        P6OutageDetector.getInstance().unregisterInvocation(this);
      }
    }
  }
 @Override
 public Object invoke(
     final Object proxy, final Object underlying, final Method method, final Object[] args)
     throws Throwable {
   // ignore calls to any methods defined on the Statement interface!
   if (!Statement.class.equals(method.getDeclaringClass())) {
     int position = (Integer) args[0];
     Object value = null;
     if (!method.getName().equals("setNull") && args.length > 1) {
       value = args[1];
     }
     preparedStatementInformation.setParameterValue(position, convertToString(value));
   }
   return method.invoke(underlying, args);
 }