类 SpringJDBCRuntimeHolder
java.lang.Object
org.anyline.data.runtime.init.AbstractRuntimeHolder
org.anyline.environment.spring.data.jdbc.runtime.SpringJDBCRuntimeHolder
- 所有已实现的接口:
org.anyline.data.runtime.RuntimeHolder
@Component("anyline.environment.spring.data.runtime.holder.jdbc")
public class SpringJDBCRuntimeHolder
extends org.anyline.data.runtime.init.AbstractRuntimeHolder
implements org.anyline.data.runtime.RuntimeHolder
-
字段概要
从类继承的字段 org.anyline.data.runtime.init.AbstractRuntimeHolder
temporary从接口继承的字段 org.anyline.data.runtime.RuntimeHolder
log, runtimes -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidstatic voidcloseConnection(Object datasource) booleanstatic SpringJDBCRuntimeHolderinstance()org.anyline.data.runtime.DataRuntime注册运行环境org.anyline.data.runtime.DataRuntimereg(String key, DataSource datasource) reg(String datasource, org.springframework.jdbc.core.JdbcTemplate template, org.anyline.data.jdbc.adapter.JDBCAdapter adapter) 注册运行环境org.anyline.data.runtime.DataRuntime注册数据源 子类覆盖 生成简单的DataRuntime不注册到spring从类继承的方法 org.anyline.data.runtime.init.AbstractRuntimeHolder
parseAdapterKey, parseCatalog, parseParamValue, parseSchema
-
构造器详细资料
-
SpringJDBCRuntimeHolder
public SpringJDBCRuntimeHolder()
-
-
方法详细资料
-
instance
-
temporary
public org.anyline.data.runtime.DataRuntime temporary(Object datasource, String database, org.anyline.data.adapter.DriverAdapter adapter) throws Exception 注册数据源 子类覆盖 生成简单的DataRuntime不注册到spring- 指定者:
temporary在接口中org.anyline.data.runtime.RuntimeHolder- 参数:
datasource- 数据源, 如DruidDataSource, MongoClientdatabase- 数据库, jdbc类型数据源不需要adapter- 如果确认数据库类型可以提供如 new MySQLAdapter(), 如果不提供则根据ds检测- 返回:
- DataRuntime
- 抛出:
Exception- 异常 Exception
-
reg
注册运行环境- 参数:
key- 数据源前缀datasource- 数据源bean id
-
reg
-
reg
public SpringJDBCRuntime reg(String datasource, org.springframework.jdbc.core.JdbcTemplate template, org.anyline.data.jdbc.adapter.JDBCAdapter adapter) 注册运行环境- 参数:
datasource- 数据源前缀template- templateadapter- adapter 可以为空 第一次执行时补齐
-
destroy
-
close
-
closeConnection
- 抛出:
Exception
-