Browse Source

UPDATE_EQUIP_SLOT db method plugged in

combat-2
MagicBot 8 months ago
parent
commit
efa7e6a03a
  1. 21
      src/engine/db/handlers/dbItemHandler.java

21
src/engine/db/handlers/dbItemHandler.java

@ -565,4 +565,25 @@ public class dbItemHandler extends dbHandlerBase {
return false; 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;
}
}
} }

Loading…
Cancel
Save