presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/JdbcModule.java/JdbcModule/getDelegate
class JdbcModule:    @Provides
    @Singleton
    @StatsCollecting
    public JdbcClient createJdbcClientWithStats(@ForBaseJdbc JdbcClient client)
    {
        StatisticsAwareJdbcClient statisticsAwareJdbcClient = new StatisticsAwareJdbcClient(client);

        Logger logger = Logger.get(format("io.prestosql.plugin.jdbc.%s.jdbcclient", catalogName));

        JdbcClient loggingInvocationsJdbcClient = newProxy(JdbcClient.class, new LoggingInvocationHandler(
                statisticsAwareJdbcClient,
                new ReflectiveParameterNamesProvider(),
                logger::debug));

        return new ForwardingJdbcClient()
        {
            @Override
            protected JdbcClient getDelegate()
            {
                if (logger.isDebugEnabled()) {
                    return loggingInvocationsJdbcClient;
                }
                return statisticsAwareJdbcClient;
            }
        };
    }