Add PLAYER_STATS DBPool

This commit is contained in:
Shaun Bennett 2016-02-19 19:33:39 -06:00
parent 6e2eea50bb
commit 7032568a92
2 changed files with 12 additions and 1 deletions

View File

@ -32,7 +32,7 @@ public class PlayerStatsRepository extends RepositoryBase
public PlayerStatsRepository()
{
super(DBPool.getStats());
super(DBPool.getPlayerStats());
}
@Override

View File

@ -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);
}
}
}