Package l2p.database

Examples of l2p.database.FiltredPreparedStatement.executeQuery()


    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT char_obj_id, slot, page, type, shortcut_id, level FROM character_shortcuts WHERE char_obj_id=? AND class_index=?");
      statement.setInt(1, player.getObjectId());
      statement.setInt(2, player.getActiveClassId());
      rset = statement.executeQuery();
      while(rset.next())
      {
        int slot = rset.getInt("slot");
        int page = rset.getInt("page");
        int type = rset.getInt("type");
View Full Code Here


    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT augAttributes,augSkillId,augSkillLevel,elemType,elemValue FROM item_attributes WHERE itemId=? LIMIT 1");
      statement.setInt(1, getObjectId());
      ResultSet rs;
      rs = statement.executeQuery();
      if(rs.next())
      {
        int aug_attributes = rs.getInt(1);
        int aug_skillId = rs.getInt(2);
        int aug_skillLevel = rs.getInt(3);
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM residence_functions WHERE id = ?");
      statement.setInt(1, getId());
      rs = statement.executeQuery();
      while(rs.next())
      {
        ResidenceFunction function = getFunction(rs.getInt("type"));
        function.setLvl(rs.getInt("lvl"));
        function.setEndTimeInMillis(rs.getInt("endTime") * 1000L);
 
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM items WHERE object_id=? LIMIT 1");
      statement.setLong(1, objectId);
      item_rset = statement.executeQuery();
      if(item_rset.next())
      {
        inst = restoreFromDb(item_rset, con, putInStorage);
      }
      else
View Full Code Here

      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())
      {
        letter.id = rs.getInt(1);
      }
      if(letter.id == 0) // письмо не добавилось в базу?
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT itemId FROM mail_attachments WHERE messageId = ?");
      statement.setInt(1, mailId);
      rs = statement.executeQuery();
      while(rs.next())
      {
        ret.add(L2ItemInstance.restoreFromDb(rs.getInt("itemId"), false));
      }
    }
View Full Code Here

        sendLock.lock();
        con = L2DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("SELECT object_id FROM items WHERE owner_id = ? AND item_id = ? AND loc = 'INVENTORY' LIMIT 1"); // сперва пробуем найти в базе его адену в инвентаре
        statement.setInt(1, player);
        statement.setInt(2, item);
        rs = statement.executeQuery();
        if(rs.next())
        {
          int id = rs.getInt("object_id");
          DatabaseUtils.closeStatement(statement);
          statement = con.prepareStatement("UPDATE items SET count=count+? WHERE object_id = ? LIMIT 1"); // если нашли увеличиваем ее количество
View Full Code Here

        sendLock.lock();
        con = L2DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("SELECT object_id FROM items WHERE owner_id = ? AND item_id = ? AND loc = 'WAREHOUSE' LIMIT 1"); // сперва пробуем найти в базе его вещь на складе
        statement.setInt(1, item.getOwnerId());
        statement.setInt(2, item.getItemId());
        rs = statement.executeQuery();
        if(rs.next())
        {
          int id = rs.getInt("object_id");
          DatabaseUtils.closeStatement(statement);
          statement = con.prepareStatement("UPDATE items SET count=count+? WHERE object_id = ? LIMIT 1"); // если нашли увеличиваем ее количество
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM clanhall WHERE id = ?");
      statement.setInt(1, getId());
      rs = statement.executeQuery();
      if(rs.next())
      {
        _name = rs.getString("name");
        _ownerId = rs.getInt("ownerId");
        _price = (long) (rs.getLong("price") * Config.RESIDENCE_LEASE_MULTIPLIER);
 
View Full Code Here

        }
      }
      DatabaseUtils.closeDatabaseSR(statement, rs);
      statement = con.prepareStatement("SELECT clan_id FROM clan_data WHERE hasHideout = ?");
      statement.setInt(1, getId());
      rs = statement.executeQuery();
      if(rs.next())
      {
        _ownerId = rs.getInt("clan_id");
      }
      _zone = ZoneManager.getInstance().getZoneByIndex(ZoneType.ClanHall, getId(), true);
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.