|
@ -21,29 +21,35 @@ public class DataSourceConfig {
|
|
|
@Value("${spring.datasource.driverClassName}")
|
|
|
private String driverClassName;
|
|
|
@Value("${spring.datasource.initialSize}")
|
|
|
private int initialSize;
|
|
|
private Integer initialSize;
|
|
|
@Value("${spring.datasource.minIdle}")
|
|
|
private int minIdle;
|
|
|
private Integer minIdle;
|
|
|
@Value("${spring.datasource.maxActive}")
|
|
|
private int maxActive;
|
|
|
private Integer maxActive;
|
|
|
@Value("${spring.datasource.maxWait}")
|
|
|
private int maxWait;
|
|
|
private Integer maxWait;
|
|
|
@Value("${spring.datasource.timeBetweenEvictionRunsMillis}")
|
|
|
private int timeBetweenEvictionRunsMillis;
|
|
|
private Integer timeBetweenEvictionRunsMillis;
|
|
|
@Value("${spring.datasource.minEvictableIdleTimeMillis}")
|
|
|
private int minEvictableIdleTimeMillis;
|
|
|
private Integer minEvictableIdleTimeMillis;
|
|
|
@Value("${spring.datasource.validationQuery}")
|
|
|
private String validationQuery;
|
|
|
@Value("${spring.datasource.testWhileIdle}")
|
|
|
private boolean testWhileIdle;
|
|
|
private Boolean testWhileIdle;
|
|
|
@Value("${spring.datasource.testOnBorrow}")
|
|
|
private boolean testOnBorrow;
|
|
|
private Boolean testOnBorrow;
|
|
|
@Value("${spring.datasource.testOnReturn}")
|
|
|
private boolean testOnReturn;
|
|
|
private Boolean testOnReturn;
|
|
|
@Value("${spring.datasource.poolPreparedStatements}")
|
|
|
private boolean poolPreparedStatements;
|
|
|
private Boolean poolPreparedStatements;
|
|
|
@Value("${spring.datasource.maxPoolPreparedStatementPerConnectionSize}")
|
|
|
private int maxPoolPreparedStatementPerConnectionSize;
|
|
|
private Integer maxPoolPreparedStatementPerConnectionSize;
|
|
|
@Value("${spring.datasource.removeAbandoned}")
|
|
|
private Boolean removeAbandoned;
|
|
|
@Value("${spring.datasource.removeAbandonedTimeout}")
|
|
|
private Integer removeAbandonedTimeout;
|
|
|
@Value("${spring.datasource.logAbandoned}")
|
|
|
private Boolean logAbandoned;
|
|
|
|
|
|
|
|
|
|
|
@ -81,8 +87,9 @@ public class DataSourceConfig {
|
|
|
datasource.setTestOnReturn(testOnReturn);
|
|
|
datasource.setPoolPreparedStatements(poolPreparedStatements);
|
|
|
datasource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize);
|
|
|
|
|
|
|
|
|
datasource.setRemoveAbandoned(removeAbandoned);
|
|
|
datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
|
|
|
datasource.setLogAbandoned(logAbandoned);
|
|
|
return datasource;
|
|
|
}
|
|
|
|
|
@ -116,6 +123,9 @@ public class DataSourceConfig {
|
|
|
datasource.setTestOnReturn(testOnReturn);
|
|
|
datasource.setPoolPreparedStatements(poolPreparedStatements);
|
|
|
datasource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize);
|
|
|
datasource.setRemoveAbandoned(removeAbandoned);
|
|
|
datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
|
|
|
datasource.setLogAbandoned(logAbandoned);
|
|
|
|
|
|
return datasource;
|
|
|
}
|
|
@ -147,6 +157,9 @@ public class DataSourceConfig {
|
|
|
datasource.setTestOnReturn(testOnReturn);
|
|
|
datasource.setPoolPreparedStatements(poolPreparedStatements);
|
|
|
datasource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize);
|
|
|
datasource.setRemoveAbandoned(removeAbandoned);
|
|
|
datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
|
|
|
datasource.setLogAbandoned(logAbandoned);
|
|
|
|
|
|
return datasource;
|
|
|
}
|