package com.hx.other.service.config;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Configuration;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import javax.sql.DataSource;
|
|
/**
|
* jdbc数据源配置
|
* @Author: cmg
|
* @Date: 2023/5/5 10:59
|
*/
|
@Configuration
|
public class JdbcTemplateConfig {
|
|
@Bean(name = "readJdbcTemplate")
|
public JdbcTemplate readJdbTemplate(@Qualifier("readDataSource") DataSource dataSource)
|
{
|
return new JdbcTemplate(dataSource);
|
}
|
}
|