@Component(value="anyline.environment.spring.data.datasource.holder.jdbc")
public class SpringJDBCDataSourceHolder
extends org.anyline.data.jdbc.datasource.JDBCDataSourceHolder
| 构造器和说明 |
|---|
SpringJDBCDataSourceHolder() |
| 限定符和类型 | 方法和说明 |
|---|---|
static DataSource |
datasource() |
static DataSource |
datasource(String key)
原生DataSource
|
static SpringJDBCDataSourceHolder |
instance() |
void |
loadCache()
在spring启动之前注册的数据源
|
String |
regTransactionManager(String key,
DataSource datasource,
boolean primary) |
org.anyline.data.runtime.DataRuntime |
runtime(String key,
Object datasource,
String database,
org.anyline.metadata.type.DatabaseType type,
org.anyline.data.adapter.DriverAdapter adapter,
boolean override) |
String |
runtime(String key,
String datasource,
boolean override)
添加数据源,同时添加事务与service
|
boolean |
validate(org.anyline.data.runtime.DataRuntime runtime) |
boolean |
validate(DataSource datasource) |
boolean |
validate(org.springframework.jdbc.core.JdbcTemplate jdbc) |
boolean |
validate(String datasource)
检测数据源是否连接正常
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheck, contains, copy, copy, copy, create, create, create, create, create, create, create, create, create, destroy, dialect, dialect, exists, hit, hit, instance, instance, instance, instance, instance, list, reg, reg, reg, reg, reg, reg, reg, reg, reg, reg, reg, reg, reg, reg, register, regTransactionManager, regTransactionManager, regTransactionManager, runtime, validate, validity, validity, value, valuepublic static SpringJDBCDataSourceHolder instance()
public static DataSource datasource(String key)
key - keypublic static DataSource datasource()
public String runtime(String key, String datasource, boolean override) throws Exception
runtime 在接口中 org.anyline.data.datasource.DataSourceHolderruntime 在类中 org.anyline.data.jdbc.datasource.JDBCDataSourceHolderkey - 数据源名称datasource - 数据源bean idoverride - 是否覆盖同名数据源Exception - 异常 Exceptionpublic org.anyline.data.runtime.DataRuntime runtime(String key, Object datasource, String database, org.anyline.metadata.type.DatabaseType type, org.anyline.data.adapter.DriverAdapter adapter, boolean override) throws Exception
runtime 在接口中 org.anyline.data.datasource.DataSourceHolderruntime 在类中 org.anyline.data.jdbc.datasource.JDBCDataSourceHolderExceptionpublic void loadCache()
public boolean validate(String datasource) throws Exception
datasource - 数据源名称Exceptionpublic boolean validate(org.springframework.jdbc.core.JdbcTemplate jdbc)
throws Exception
Exceptionpublic boolean validate(DataSource datasource) throws Exception
validate 在类中 org.anyline.data.jdbc.datasource.JDBCDataSourceHolderExceptionpublic boolean validate(org.anyline.data.runtime.DataRuntime runtime)
throws Exception
validate 在接口中 org.anyline.data.datasource.DataSourceHoldervalidate 在类中 org.anyline.data.jdbc.datasource.JDBCDataSourceHolderExceptionpublic String regTransactionManager(String key, DataSource datasource, boolean primary)
regTransactionManager 在接口中 org.anyline.data.datasource.DataSourceHolderregTransactionManager 在类中 org.anyline.data.jdbc.datasource.JDBCDataSourceHolderCopyright © 2025. All rights reserved.