Skip to content

Commit

Permalink
Merge 7972097 into 4415e52
Browse files Browse the repository at this point in the history
  • Loading branch information
sunbufu committed Jul 17, 2019
2 parents 4415e52 + 7972097 commit 448d5ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Expand Up @@ -61,6 +61,7 @@ public DataSource build(final String dataSourceName, final YamlDataSourceParamet
config.setMaxLifetime(dataSourceParameter.getMaxLifetimeMilliseconds());
config.setMaximumPoolSize(dataSourceParameter.getMaxPoolSize());
config.setMinimumIdle(dataSourceParameter.getMinPoolSize());
config.setReadOnly(dataSourceParameter.isReadonly());
config.addDataSourceProperty("useServerPrepStmts", Boolean.TRUE.toString());
config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", 250);
Expand Down
Expand Up @@ -49,4 +49,6 @@ public final class YamlDataSourceParameter {
private int minPoolSize = 1;

private long maintenanceIntervalMilliseconds = 30 * 1000;

private boolean readonly = false;
}
Expand Up @@ -89,6 +89,7 @@ private static DataSourceConfiguration createDataSourceConfiguration(final YamlD
result.getProperties().put("maxPoolSize", dataSourceParameter.getMaxPoolSize());
result.getProperties().put("minPoolSize", dataSourceParameter.getMinPoolSize());
result.getProperties().put("maintenanceIntervalMilliseconds", dataSourceParameter.getMaintenanceIntervalMilliseconds());
result.getProperties().put("readonly", dataSourceParameter.isReadonly());
return result;
}
}

0 comments on commit 448d5ba

Please sign in to comment.