注释 @Resource 的使用可参看
http://blog.sina.com.cn/s/blog_a795a96f01016if1.html 这篇文章
缺省的数据源配置
第二个数据源配置,没有事务处理
在代码中的使用
//------
// 基础数据源
private JdbcTemplate jdbcTemplate;
// 业务数据库
private JdbcTemplate EASTCOM2;
/**
* 基础数据源
*
* @param dataSource
* @throws Exception
*/
@Resource(name = "dataSource")
public void setDataSource(DataSource dataSource) throws Exception {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
/**
* 业务数据库
* @param eASTCOM2
* @throws Exception
*/
@Resource(name = "ecipDataSource")
public void setEASTCOM2(DataSource EASTCOM2) throws Exception {
this.EASTCOM2 = new JdbcTemplate(EASTCOM2);
}