Database now uses prefix for checking if table exists and also disables plugin upon database error

This commit is contained in:
The_Creeper_Cow 2018-10-09 10:25:29 +02:00
parent cdec1ccc07
commit 5dfd859497

View File

@ -27,12 +27,13 @@ public class StorageMysql extends Storage {
public boolean containsGroup(String group) {
try {
DatabaseMetaData dbm = database.getConnection().getMetaData();
ResultSet rs = dbm.getTables(null, null, group, null);
ResultSet rs = dbm.getTables(null, null, instance.getConfig().getString("Database.Prefix")+group, null);
if (rs.next()) {
return true;
}
} catch (SQLException e) {
e.printStackTrace();
instance.getServer().getPluginManager().disablePlugin(instance);
}
return false;