Package l2p.database

Examples of l2p.database.FiltredPreparedStatement.executeUpdate()


          DatabaseUtils.closeStatement(statement);
          statement = con.prepareStatement("INSERT INTO items_delayed (owner_id,item_id,`count`,description) VALUES (?,?,?,'mail')"); // иначе используем items_delayed
          statement.setLong(1, player);
          statement.setLong(2, item);
          statement.setLong(3, count);
          statement.executeUpdate();
        }
      }
      catch(SQLException 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, item.getCount());
          statement.setInt(2, id);
          statement.executeUpdate();
        }
        else
        {
          item.setLocation(ItemLocation.WAREHOUSE);
          item.updateDatabase(true, false);
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE clanhall SET paidUntil=?, inDebt=? WHERE id=?");
      statement.setLong(1, _paidUntil.getTimeInMillis());
      statement.setLong(2, _inDebt ? 1 : 0);
      statement.setInt(3, getId());
      statement.executeUpdate();
    }
    catch(Exception e)
    {
      _log.warning("Exception: ClanHall.updateRentTime(): " + e);
    }
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      String stmt = "UPDATE characters SET characters.accesslevel = ? WHERE characters.char_name=?";
      statement = con.prepareStatement(stmt);
      statement.setInt(1, banLevel);
      statement.setString(2, user);
      statement.executeUpdate();
    }
    catch(Exception e)
    {
      _log.warning("Could not set accessLevl:" + e);
    }
View Full Code Here

          statement.setString(4, festivalDat.getString("names", ""));
          statement.setInt(5, festivalCycle);
          statement.setString(6, cabal);
          statement.setInt(7, festivalId);
          // If there was no record to update, assume it doesn't exist and add a new one, otherwise continue with the next record to store.
          if(statement.executeUpdate() > 0)
          {
            statement.close();
            continue;
          }
          DatabaseUtils.closeStatement(statement);
View Full Code Here

        for(int i = 0; i < SevenSignsFestival.FESTIVAL_COUNT; i++)
        {
          statement.setLong(18 + i, SevenSignsFestival.getInstance().getAccumulatedBonus(i));
        }
        statement.setInt(18 + SevenSignsFestival.FESTIVAL_COUNT, Calendar.getInstance().get(Calendar.DAY_OF_WEEK));
        statement.executeUpdate();
      }
    }
    catch(SQLException e)
    {
      _log.severe("Unable to save Seven Signs data: " + e);
View Full Code Here

      else
      {
        statement = con.prepareStatement("DELETE FROM item_attributes WHERE itemId = ? LIMIT 1");
      }
      statement.setInt(1, getObjectId());
      statement.executeUpdate();
    }
    catch(Exception e)
    {
      _log.info("Could not remove augmentation for item: " + getObjectId() + " from DB:");
      e.printStackTrace();
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM item_attributes WHERE itemId = ?");
      statement.setInt(1, getObjectId());
      statement.executeUpdate();
    }
    catch(Exception e)
    {
      _log.info("Could not remove attributes for item: " + getObjectId() + " from DB:");
      e.printStackTrace();
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      final String stmt = "UPDATE characters SET nochannel = ? WHERE obj_Id=?";
      statement = con.prepareStatement(stmt);
      statement.setLong(1, _NoChannel > 0 ? _NoChannel / 1000 : _NoChannel);
      statement.setInt(2, getObjectId());
      statement.executeUpdate();
    }
    catch(final Exception e)
    {
      _log.warning("Could not activate nochannel:" + e);
    }
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE character_subclasses SET class_id=? WHERE char_obj_id=? AND class_id=?");
      statement.setInt(1, newclass);
      statement.setInt(2, getObjectId());
      statement.setInt(3, oldclass);
      statement.executeUpdate();
      DatabaseUtils.closeStatement(statement);
      statement = con.prepareStatement("DELETE FROM character_hennas WHERE char_obj_id=? AND class_index=?");
      statement.setInt(1, getObjectId());
      statement.setInt(2, newclass);
      statement.executeUpdate();
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.