Plex/src/main/java/me/totalfreedom/plex/util/PlexUtils.java

36 lines
952 B
Java
Raw Normal View History

package me.totalfreedom.plex.util;
2020-10-28 03:49:56 +00:00
import java.sql.SQLException;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.storage.StorageType;
public class PlexUtils
{
public static void testConnections()
{
if (Plex.get().getSqlConnection().getCon() != null)
{
if (Plex.get().getStorageType() == StorageType.SQL)
{
PlexLog.log("Successfully enabled MySQL!");
2020-10-28 03:49:56 +00:00
}
else if (Plex.get().getStorageType() == StorageType.SQLITE)
{
PlexLog.log("Successfully enabled SQLite!");
}
2020-10-28 03:49:56 +00:00
try
{
Plex.get().getSqlConnection().getCon().close();
}
2020-10-28 03:49:56 +00:00
catch (SQLException ignored)
{
}
}
else if (Plex.get().getMongoConnection().getDatastore() != null)
{
PlexLog.log("Successfully enabled MongoDB!");
}
}
}