oracle链接问题
This commit is contained in:
@@ -49,7 +49,8 @@ public class PrimaryDataSourceConfig {
|
|||||||
dataSource.setMaxWait(properties.getMaxWait());
|
dataSource.setMaxWait(properties.getMaxWait());
|
||||||
dataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
|
dataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
|
||||||
dataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
|
dataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
|
||||||
|
dataSource.setValidationQuery(properties.getValidationQuery());
|
||||||
|
|
||||||
return dataSource;
|
return dataSource;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ public class PrimaryDsProperties {
|
|||||||
private boolean poolPreparedStatements;
|
private boolean poolPreparedStatements;
|
||||||
|
|
||||||
private boolean testOnBorrow;
|
private boolean testOnBorrow;
|
||||||
|
|
||||||
|
private String validationQuery;
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
return url;
|
return url;
|
||||||
@@ -133,4 +135,12 @@ public class PrimaryDsProperties {
|
|||||||
public void setTestOnBorrow(boolean testOnBorrow) {
|
public void setTestOnBorrow(boolean testOnBorrow) {
|
||||||
this.testOnBorrow = 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.setMaxWait(properties.getMaxWait());
|
||||||
dataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
|
dataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
|
||||||
dataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
|
dataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
|
||||||
|
dataSource.setValidationQuery(properties.getValidationQuery());
|
||||||
|
|
||||||
return dataSource;
|
return dataSource;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ public class SecondaryDsProperties {
|
|||||||
|
|
||||||
private boolean testOnBorrow;
|
private boolean testOnBorrow;
|
||||||
|
|
||||||
|
private String validationQuery;
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
@@ -133,4 +135,12 @@ public class SecondaryDsProperties {
|
|||||||
public void setTestOnBorrow(boolean testOnBorrow) {
|
public void setTestOnBorrow(boolean testOnBorrow) {
|
||||||
this.testOnBorrow = testOnBorrow;
|
this.testOnBorrow = testOnBorrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getValidationQuery() {
|
||||||
|
return validationQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidationQuery(String validationQuery) {
|
||||||
|
this.validationQuery = validationQuery;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ spring:
|
|||||||
driver: oracle.jdbc.driver.OracleDriver
|
driver: oracle.jdbc.driver.OracleDriver
|
||||||
max-active: 30
|
max-active: 30
|
||||||
test-on-borrow: true
|
test-on-borrow: true
|
||||||
validation-query: SELECT 1
|
validation-query: SELECT 1 FROM dual
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
min-idle: 1
|
min-idle: 1
|
||||||
max-wait: 60000
|
max-wait: 60000
|
||||||
|
|||||||
Reference in New Issue
Block a user