oracle链接问题

This commit is contained in:
fanghongchao
2018-12-24 14:32:20 +08:00
parent 7791bbf4d4
commit a4b28f718a
5 changed files with 24 additions and 2 deletions
@@ -49,6 +49,7 @@ public class PrimaryDataSourceConfig {
dataSource.setMaxWait(properties.getMaxWait());
dataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
dataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
dataSource.setValidationQuery(properties.getValidationQuery());
return dataSource;
}
@@ -30,6 +30,8 @@ public class PrimaryDsProperties {
private boolean testOnBorrow;
private String validationQuery;
public String getUrl() {
return url;
}
@@ -133,4 +135,12 @@ public class PrimaryDsProperties {
public void setTestOnBorrow(boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
}
public String getValidationQuery() {
return validationQuery;
}
public void setValidationQuery(String validationQuery) {
this.validationQuery = validationQuery;
}
}
@@ -46,6 +46,7 @@ public class SecondaryDataSourceConfig {
dataSource.setMaxWait(properties.getMaxWait());
dataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
dataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
dataSource.setValidationQuery(properties.getValidationQuery());
return dataSource;
}
@@ -30,6 +30,8 @@ public class SecondaryDsProperties {
private boolean testOnBorrow;
private String validationQuery;
public String getUrl() {
return url;
}
@@ -133,4 +135,12 @@ public class SecondaryDsProperties {
public void setTestOnBorrow(boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
}
public String getValidationQuery() {
return validationQuery;
}
public void setValidationQuery(String validationQuery) {
this.validationQuery = validationQuery;
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ spring:
driver: oracle.jdbc.driver.OracleDriver
max-active: 30
test-on-borrow: true
validation-query: SELECT 1
validation-query: SELECT 1 FROM dual
initial-size: 10
min-idle: 1
max-wait: 60000