guang
2023-05-05 566411019444e53ca143298ee490d33cf510e28c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
    }
}