mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-02-02 21:11:40 +01:00
Database now uses prefix for checking if table exists and also disables plugin upon database error
This commit is contained in:
parent
cdec1ccc07
commit
5dfd859497
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user