All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hiboot.mcn.autoconfigure.jdbc.DataSourceHolder Maven / Gradle / Ivy

package cn.hiboot.mcn.autoconfigure.jdbc;

/**
 * DataSourceHolder
 *
 * @author DingHao
 * @since 2022/7/28 16:25
 */
public class DataSourceHolder {
    private static final ThreadLocal dataSources = new InheritableThreadLocal<>();

    public static void setDataSource(String datasource) {
        dataSources.set(datasource);
    }

    public static String getDataSource() {
        return dataSources.get();
    }

    public static void clearDataSource() {
        dataSources.remove();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy