Package l2p.database

Examples of l2p.database.FiltredPreparedStatement.executeUpdate()


          statement.setInt(4, _augmentation.getSkill().getLevel());
        }
      }
      statement.setByte(5, _enchantAttributeElement);
      statement.setInt(6, _enchantAttributeValue);
      statement.executeUpdate();
    }
    catch(Exception e)
    {
      _log.info("Could not remove elemental enchant for item: " + getObjectId() + " from DB:");
      e.printStackTrace();
View Full Code Here


      statement.setInt(5, getEnchantLevel());
      statement.setInt(6, _lifeTimeRemaining);
      statement.setInt(7, getItemId());
      statement.setInt(8, _customFlags);
      statement.setInt(9, getObjectId());
      statement.executeUpdate();
      _existsInDb = true;
      _storedInDb = true;
    }
    catch(Exception e)
    {
View Full Code Here

      statement.setInt(9, _type2);
      statement.setInt(10, _lifeTimeRemaining);
      statement.setString(11, getName());
      statement.setString(12, getItemClass().name());
      statement.setInt(13, _customFlags);
      statement.executeUpdate();
      _existsInDb = true;
      _storedInDb = true;
      Stat.increaseInsertItemCount();
    }
    catch(Exception e)
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM items WHERE object_id = ? LIMIT 1");
      statement.setInt(1, _objectId);
      statement.executeUpdate();
      _existsInDb = false;
      _storedInDb = false;
      Stat.increaseDeleteItemCount();
    }
    catch(Exception e)
View Full Code Here

      statement = con.prepareStatement("UPDATE residence_functions SET endTime=?, inDebt=? WHERE type=? AND id=?");
      statement.setInt(1, (int) (getEndTimeInMillis() / 1000));
      statement.setInt(2, inDebt ? 1 : 0);
      statement.setInt(3, getType());
      statement.setInt(4, getResidenceId());
      statement.executeUpdate();
    }
    catch(Exception e)
    {
      _log.log(Level.SEVERE, "Exception: ResidenceFunction.updateRentTime(boolean inDebt): " + e.getMessage(), e);
    }
View Full Code Here

      stmnt.setString(4, letter.body);
      stmnt.setInt(5, attachments == null ? 0 : attachments.length);
      stmnt.setLong(6, letter.price);
      stmnt.setLong(7, letter.validtime);
      stmnt.setInt(8, letter.system);
      stmnt.executeUpdate();
      DatabaseUtils.closeStatement(stmnt);
      stmnt = con.prepareStatement("SELECT LAST_INSERT_ID()");
      rs = stmnt.executeQuery();
      if(rs.next())
      {
View Full Code Here

          item.setLocation(ItemLocation.LEASE);
          item.updateDatabase(true, false);
          letter.attached.add(new TradeItem(item));
          stmnt.setInt(1, letter.id);
          stmnt.setInt(2, item.getObjectId());
          stmnt.executeUpdate();
        }
        letter.attachments = letter.attached.size();
      }
    }
    catch(Exception e)
View Full Code Here

            lettersByReceiverCache.remove(letter.receiverId);
          }
        }
        removed.add(letter);
        stmnt.setInt(1, id);
        stmnt.executeUpdate();
      }
      DatabaseUtils.closeStatement(stmnt);
      stmnt = con.prepareStatement("DELETE FROM mail_attachments WHERE messageId=? LIMIT ?");
      for(Letter letter : removed)
      {
View Full Code Here

      stmnt = con.prepareStatement("DELETE FROM mail_attachments WHERE messageId=? LIMIT ?");
      for(Letter letter : removed)
      {
        stmnt.setInt(1, letter.id);
        stmnt.setInt(2, letter.attachments);
        stmnt.executeUpdate();
      }
    }
    catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

          int id = rs.getInt("object_id");
          DatabaseUtils.closeStatement(statement);
          statement = con.prepareStatement("UPDATE items SET count=count+? WHERE object_id = ? LIMIT 1"); // если нашли увеличиваем ее количество
          statement.setLong(1, count);
          statement.setInt(2, id);
          statement.executeUpdate();
        }
        else
        {
          DatabaseUtils.closeStatement(statement);
          statement = con.prepareStatement("INSERT INTO items_delayed (owner_id,item_id,`count`,description) VALUES (?,?,?,'mail')"); // иначе используем items_delayed
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.