All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pub.codex.common.db.conf.JDBCTemplateConfig Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package pub.codex.common.db.conf;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

@Configuration
public class JDBCTemplateConfig {

    /**
     * 创建JDBC连接
     *
     * @return
     */
    @Bean
    public JdbcTemplate jdbcTemplate(DriverManagerDataSource driverManagerDataSourceCodex) {

        JdbcTemplate jdbcTemplate = new JdbcTemplate(driverManagerDataSourceCodex);
        return jdbcTemplate;
    }

    @Bean
    @ConfigurationProperties("codex.jdbc")
    public DriverManagerDataSource DriverManagerDataSourceCodex() {
        return new DriverManagerDataSource();
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy