Don't use limit with sqlite. Fixes #89

Gives a strange error when using limit with sqlite.
This commit is contained in:
graywolf336 2015-07-23 14:09:55 -05:00
parent 44ce2c7cfe
commit 890923fca7

View File

@ -1128,6 +1128,19 @@ public class JailIO {
switch(storage) {
case 1:
try {
PreparedStatement p = getConnection().prepareStatement("delete from `" + prefix + "cells` where name = ? and jail = ?;");
p.setString(1, c.getName());
p.setString(2, j.getName());
p.executeUpdate();
p.close();
} catch (SQLException e) {
e.printStackTrace();
pl.getLogger().severe("---------- Jail Error!!! ----------");
pl.getLogger().severe("Error while removing the cell '" + c.getName() + "' from the Jail '" + j.getName() + "', please check the error and fix what is wrong.");
}
break;
case 2:
try {
PreparedStatement p = getConnection().prepareStatement("delete from `" + prefix + "cells` where name = ? and jail = ? limit 1;");