Add PLAYER_STATS DBPool
This commit is contained in:
parent
6e2eea50bb
commit
7032568a92
@ -32,7 +32,7 @@ public class PlayerStatsRepository extends RepositoryBase
|
||||
|
||||
public PlayerStatsRepository()
|
||||
{
|
||||
super(DBPool.getStats());
|
||||
super(DBPool.getPlayerStats());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@ public final class DBPool
|
||||
private static DataSource QUEUE;
|
||||
private static DataSource MINEPLEX;
|
||||
private static DataSource STATS_MINEPLEX;
|
||||
private static DataSource PLAYER_STATS;
|
||||
|
||||
private static DataSource openDataSource(String url, String username, String password)
|
||||
{
|
||||
@ -67,6 +68,14 @@ public final class DBPool
|
||||
return STATS_MINEPLEX;
|
||||
}
|
||||
|
||||
public static DataSource getPlayerStats()
|
||||
{
|
||||
if (PLAYER_STATS == null)
|
||||
loadDataSources();
|
||||
|
||||
return PLAYER_STATS;
|
||||
}
|
||||
|
||||
private static void loadDataSources()
|
||||
{
|
||||
try
|
||||
@ -115,6 +124,8 @@ public final class DBPool
|
||||
MINEPLEX = openDataSource("jdbc:mysql://" + dbHost, userName, password);
|
||||
else if (dbSource.toUpperCase().equalsIgnoreCase("STATS"))
|
||||
STATS_MINEPLEX = openDataSource("jdbc:mysql://" + dbHost, userName, password);
|
||||
else if (dbSource.toUpperCase().equalsIgnoreCase("PLAYER_STATS"))
|
||||
PLAYER_STATS = openDataSource("jdbc:mysql://" + dbHost, userName, password);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user