This code looks like a duplicate of JdbcConnector#decorateDataSourceIfRequired. Can you refactor?