public final class DataSourceHolder extends Object
| Constructor and Description |
|---|
DataSourceHolder() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkDynamicDataSourceReady() |
static DatabaseType |
currentDatabaseType() |
static JdbcDataSource |
currentDataSource() |
static boolean |
currentExisting() |
static boolean |
currentIsDefault() |
static reactor.core.publisher.Mono<R2dbcDataSource> |
currentR2dbc() |
static JdbcDataSource |
dataSource(String dataSourceId)
根据指定的数据源id获取动态数据源
|
static DatabaseType |
defaultDatabaseType() |
static JdbcDataSource |
defaultDataSource() |
static boolean |
existing(String id)
判断指定id的数据源是否存在
|
static boolean |
isDynamicDataSourceReady() |
static R2dbcSwitcher |
r2dbcSwitcher() |
static JdbcSwitcher |
switcher() |
public static boolean isDynamicDataSourceReady()
public static void checkDynamicDataSourceReady()
public static JdbcSwitcher switcher()
public static R2dbcSwitcher r2dbcSwitcher()
public static JdbcDataSource defaultDataSource()
public static JdbcDataSource dataSource(String dataSourceId)
dataSourceId - 数据源idDataSourceNotFoundException - 如果数据源不存在将抛出此异常public static JdbcDataSource currentDataSource()
public static reactor.core.publisher.Mono<R2dbcDataSource> currentR2dbc()
public static boolean currentIsDefault()
public static boolean existing(String id)
id - 数据源id DynamicDataSource.getId()public static boolean currentExisting()
public static DatabaseType currentDatabaseType()
public static DatabaseType defaultDatabaseType()
Copyright © 2016–2021. All rights reserved.