mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-02-09 08:21:28 +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) {
|
public boolean containsGroup(String group) {
|
||||||
try {
|
try {
|
||||||
DatabaseMetaData dbm = database.getConnection().getMetaData();
|
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()) {
|
if (rs.next()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
instance.getServer().getPluginManager().disablePlugin(instance);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user