code: public Object invoke(MethodInvocation invocation) throws Throwable {
  
          Object retVal = invocation.proceed();
  
          // only when return value is connection, return proxy.
          if (!(retVal instanceof Connection)) {
              return retVal;
          }
  
          Connection conn = (Connection) retVal;
          String connId = this.proxyConfig.getConnectionIdManager().getId(conn);
          ConnectionInfo connectionInfo = new ConnectionInfo();
          connectionInfo.setConnectionId(connId);
          connectionInfo.setDataSourceName("");
  
          return this.proxyConfig.getJdbcProxyFactory().createConnection((Connection) retVal, connectionInfo, this.proxyConfig);
      }
docs: default