File tree Expand file tree Collapse file tree
Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,18 @@ public MySQLDB(Supplier<Locale> locale) {
2929 super (locale );
3030 }
3131
32+ private static synchronized void increment () {
33+ increment ++;
34+ }
35+
36+ /**
37+ * @return the name of the Database
38+ */
39+ @ Override
40+ public String getName () {
41+ return "MySQL" ;
42+ }
43+
3244 /**
3345 * Setups the {@link HikariDataSource}
3446 */
@@ -55,7 +67,7 @@ public void setupDataSource() throws DBInitException {
5567
5668 config .setPoolName ("Plan Connection Pool-" + increment );
5769 config .setDriverClassName ("com.mysql.jdbc.Driver" );
58- increment ++ ;
70+ increment () ;
5971
6072 config .setAutoCommit (true );
6173 config .setMaximumPoolSize (8 );
@@ -69,14 +81,6 @@ public void setupDataSource() throws DBInitException {
6981 }
7082 }
7183
72- /**
73- * @return the name of the Database
74- */
75- @ Override
76- public String getName () {
77- return "MySQL" ;
78- }
79-
8084 @ Override
8185 public Connection getConnection () throws SQLException {
8286 Connection connection = dataSource .getConnection ();
You can’t perform that action at this time.
0 commit comments