Fix smell with incrementation

This commit is contained in:
Rsl1122 2018-08-06 12:06:52 +03:00
parent 6aae5be083
commit a515357736

View File

@ -29,6 +29,18 @@ public class MySQLDB extends SQLDB {
super(locale);
}
private static synchronized void increment() {
increment++;
}
/**
* @return the name of the Database
*/
@Override
public String getName() {
return "MySQL";
}
/**
* Setups the {@link HikariDataSource}
*/
@ -55,7 +67,7 @@ public class MySQLDB extends SQLDB {
config.setPoolName("Plan Connection Pool-" + increment);
config.setDriverClassName("com.mysql.jdbc.Driver");
increment++;
increment();
config.setAutoCommit(true);
config.setMaximumPoolSize(8);
@ -69,14 +81,6 @@ public class MySQLDB extends SQLDB {
}
}
/**
* @return the name of the Database
*/
@Override
public String getName() {
return "MySQL";
}
@Override
public Connection getConnection() throws SQLException {
Connection connection = dataSource.getConnection();