本文整理匯總了Java中org.springframework.jdbc.datasource.DataSourceTransactionManager.setDataSource方法的典型用法代碼示例。如果您正苦於以下問題:Java DataSourceTransactionManager.setDataSource方法的具體用法?Java DataSourceTransactionManager.setDataSource怎麽用?Java DataSourceTransactionManager.setDataSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.jdbc.datasource.DataSourceTransactionManager
的用法示例。
在下文中一共展示了DataSourceTransactionManager.setDataSource方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: read2TransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "read2TransactionManager")
public DataSourceTransactionManager read2TransactionManager(
@Qualifier("read2DataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例2: writeTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "writeTransactionManager")
public DataSourceTransactionManager writeTransactionManager(
@Qualifier("writeDataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例3: read1TransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "read1TransactionManager")
public DataSourceTransactionManager read1TransactionManager(
@Qualifier("read1DataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例4: masterTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "masterTransactionManager")
@Primary
public DataSourceTransactionManager masterTransactionManager(
@Qualifier("masterDataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例5: clusterTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "clusterTransactionManager")
public DataSourceTransactionManager clusterTransactionManager(
@Qualifier("clusterDataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例6: cluster1TransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "cluster1TransactionManager")
public DataSourceTransactionManager cluster1TransactionManager(
@Qualifier("cluster1DataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例7: transactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
/**
* 配置事物管理器
*
* @return
*/
@Bean
public DataSourceTransactionManager transactionManager() {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例8: create
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
public DataSourceTransactionManager create() {
DataSourceTransactionManager dm = new DataSourceTransactionManager();
dm.setDataSource((DataSource) getContext().getBean(DataSourceBox.class));
return dm;
}
示例9: getTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //導入方法依賴的package包/類
@Bean
public DataSourceTransactionManager getTransactionManager() {
DataSourceTransactionManager txManager = new DataSourceTransactionManager();
txManager.setDataSource(getDataSource());
return txManager;
}