org.springframework.boot.jdbc

Class DataSourceUnwrapper



  • public final class DataSourceUnwrapper
    extends Object
    Unwraps a DataSource that may have been proxied or wrapped in a custom Wrapper such as DelegatingDataSource.
    Since:
    2.0.7
    Author:
    Tadaya Tsuyukubo, Stephane Nicoll
    • Method Detail

      • unwrap

        public static <T> T unwrap(DataSource dataSource,
                                   Class<T> target)
        Return an object that implements the given target type, unwrapping delegate or proxy if necessary.
        Type Parameters:
        T - the target type
        Parameters:
        dataSource - the datasource to handle
        target - the type that the result must implement
        Returns:
        an object that implements the target type or null

Copyright © 2020 Pivotal Software, Inc.. All rights reserved.