UPDATE_EQUIP_SLOT db method plugged in
This commit is contained in:
@@ -565,4 +565,25 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean UPDATE_EQUIP_SLOT(Item item) {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `equipSlot`=? WHERE `UID` = ?")) {
|
||||
|
||||
if (item.equipSlot.equals(Enum.EquipSlotType.NONE))
|
||||
preparedStatement.setString(1, "");
|
||||
else
|
||||
preparedStatement.setString(1, item.equipSlot.name());
|
||||
|
||||
preparedStatement.setLong(2, item.getObjectUUID());
|
||||
|
||||
return (preparedStatement.executeUpdate() > 0);
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user