diff options
author | drecchia <danilo@deltatecnologia.com> | 2016-06-01 09:56:30 -0300 |
---|---|---|
committer | drecchia <danilo@deltatecnologia.com> | 2016-06-01 09:56:30 -0300 |
commit | 5df7c128af15e9d1021b7570f081185f14467f09 (patch) | |
tree | f0fa176e2d4eab23f37ce802d4b1ce3ceda9d748 /src/org/traccar/database/DataManager.java | |
parent | 1c0ccc88eb1482297d4bfaebd7d72505f55625cd (diff) | |
download | trackermap-server-5df7c128af15e9d1021b7570f081185f14467f09.tar.gz trackermap-server-5df7c128af15e9d1021b7570f081185f14467f09.tar.bz2 trackermap-server-5df7c128af15e9d1021b7570f081185f14467f09.zip |
- Minor changes as requested in pull request.
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index cf2b03d56..19560db5c 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -110,23 +110,21 @@ public class DataManager implements IdentityManager { Class.forName(driver); } - HikariConfig hConfig = new HikariConfig(); - hConfig.setDriverClassName(config.getString("database.driver")); - hConfig.setJdbcUrl(config.getString("database.url")); - hConfig.setUsername(config.getString("database.user")); - hConfig.setPassword(config.getString("database.password")); - hConfig.setConnectionInitSql("SELECT 1 FROM DUAL"); - hConfig.setIdleTimeout(600000); // milliseconds -// ds.setIdleConnectionTestPeriod(600); -// ds.setMaxStatementsPerConnection(config.getInteger("database.maxStatements")); + HikariConfig hikariConfig = new HikariConfig(); + hikariConfig.setDriverClassName(config.getString("database.driver")); + hikariConfig.setJdbcUrl(config.getString("database.url")); + hikariConfig.setUsername(config.getString("database.user")); + hikariConfig.setPassword(config.getString("database.password")); + hikariConfig.setConnectionInitSql("SELECT 1 FROM DUAL"); + hikariConfig.setIdleTimeout(600000); int maxPoolSize = config.getInteger("database.maxPoolSize"); if (maxPoolSize != 0) { - hConfig.setMaximumPoolSize(maxPoolSize); + hikariConfig.setMaximumPoolSize(maxPoolSize); } - dataSource = new HikariDataSource(hConfig); + dataSource = new HikariDataSource(hikariConfig); } } |