mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-24 17:11:43 +01:00
Fix smell with incrementation
This commit is contained in:
parent
6aae5be083
commit
a515357736
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user