Reset by spring-boot 1.5.9
parent
5d6bea4dc9
commit
a6141a6e53
|
@ -1,14 +1,10 @@
|
|||
package com.monkeyk.sos.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
|
@ -28,41 +24,8 @@ import javax.sql.DataSource;
|
|||
public class ContextConfigurer {
|
||||
|
||||
|
||||
@Bean
|
||||
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
return new PropertySourcesPlaceholderConfigurer();
|
||||
}
|
||||
|
||||
|
||||
@Value("${jdbc.driverClassName}")
|
||||
private String driverClassName;
|
||||
|
||||
@Value("${jdbc.url}")
|
||||
private String jdbcUrl;
|
||||
|
||||
@Value("${jdbc.username}")
|
||||
private String jdbcUsername;
|
||||
|
||||
@Value("${jdbc.password}")
|
||||
private String jdbcPassword;
|
||||
|
||||
@Bean(name = "dataSource")
|
||||
public DataSource dataSource() {
|
||||
DriverManagerDataSource dataSource = new DriverManagerDataSource();
|
||||
dataSource.setDriverClassName(driverClassName);
|
||||
dataSource.setUrl(jdbcUrl);
|
||||
dataSource.setUsername(jdbcUsername);
|
||||
dataSource.setPassword(jdbcPassword);
|
||||
|
||||
// dataSource.setValidationQuery("SELECT 1");
|
||||
// dataSource.setTestOnReturn(false);
|
||||
// dataSource.setTestOnBorrow(true);
|
||||
//
|
||||
// dataSource.setMaxActive(20);
|
||||
// dataSource.setMaxIdle(5);
|
||||
|
||||
return dataSource;
|
||||
}
|
||||
|
||||
|
||||
@Bean(name = "transactionManager")
|
||||
|
|
Loading…
Reference in New Issue