Package l2p.database

Examples of l2p.database.FiltredStatement.executeUpdate()


    FiltredStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      statement.executeUpdate("UPDATE epic_boss_spawn SET respawnDate=" + _respawnDate / 1000 + ", state=" + _state.ordinal() + " WHERE bossId=" + _bossId);
      _log.info("update EpicBossState: ID:" + _bossId + ", RespawnDate:" + _respawnDate / 1000 + ", State:" + _state.toString());
    }
    catch(Exception e)
    {
      _log.warn("Exeption on update EpicBossState: ID " + _bossId + ", RespawnDate:" + _respawnDate / 1000 + ", State:" + _state.toString(), e);
View Full Code Here


    FiltredStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      statement.executeUpdate("UPDATE mail SET mail.unread=0 WHERE mail.messageId=" + mailId + " LIMIT 1");
    }
    catch(SQLException e)
    {
      e.printStackTrace();
    }
View Full Code Here

    {
      sendLock.lock();
      con = L2DatabaseFactory.getInstance().getConnection();
      // удаляем почту у удаленных чаров
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail FROM mail LEFT JOIN characters ON mail.sender = characters.obj_Id WHERE characters.obj_Id IS NULL");
      DatabaseUtils.closeStatement(stmt);
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail FROM mail LEFT JOIN characters ON mail.receiver = characters.obj_Id WHERE characters.obj_Id IS NULL");
      DatabaseUtils.closeStatement(stmt);
      // удаляем протухшие письма
View Full Code Here

      // удаляем почту у удаленных чаров
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail FROM mail LEFT JOIN characters ON mail.sender = characters.obj_Id WHERE characters.obj_Id IS NULL");
      DatabaseUtils.closeStatement(stmt);
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail FROM mail LEFT JOIN characters ON mail.receiver = characters.obj_Id WHERE characters.obj_Id IS NULL");
      DatabaseUtils.closeStatement(stmt);
      // удаляем протухшие письма
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE FROM mail WHERE UNIX_TIMESTAMP(expire) < UNIX_TIMESTAMP()");
      DatabaseUtils.closeStatement(stmt);
View Full Code Here

      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail FROM mail LEFT JOIN characters ON mail.receiver = characters.obj_Id WHERE characters.obj_Id IS NULL");
      DatabaseUtils.closeStatement(stmt);
      // удаляем протухшие письма
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE FROM mail WHERE UNIX_TIMESTAMP(expire) < UNIX_TIMESTAMP()");
      DatabaseUtils.closeStatement(stmt);
      // удаляем некорректные аттачи
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail_attachments FROM mail_attachments LEFT JOIN items ON mail_attachments.itemId = items.object_id WHERE items.object_id IS NULL");
      DatabaseUtils.closeStatement(stmt);
View Full Code Here

      stmt = con.createStatement();
      stmt.executeUpdate("DELETE FROM mail WHERE UNIX_TIMESTAMP(expire) < UNIX_TIMESTAMP()");
      DatabaseUtils.closeStatement(stmt);
      // удаляем некорректные аттачи
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail_attachments FROM mail_attachments LEFT JOIN items ON mail_attachments.itemId = items.object_id WHERE items.object_id IS NULL");
      DatabaseUtils.closeStatement(stmt);
      // чистим письма с потерянными аттачами
      stmt = con.createStatement();
      stmt.executeUpdate("UPDATE mail LEFT JOIN mail_attachments ON mail.messageId = mail_attachments.messageId SET price=0,attachments=0 WHERE mail_attachments.messageId IS NULL");
      DatabaseUtils.closeStatement(stmt);
View Full Code Here

      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail_attachments FROM mail_attachments LEFT JOIN items ON mail_attachments.itemId = items.object_id WHERE items.object_id IS NULL");
      DatabaseUtils.closeStatement(stmt);
      // чистим письма с потерянными аттачами
      stmt = con.createStatement();
      stmt.executeUpdate("UPDATE mail LEFT JOIN mail_attachments ON mail.messageId = mail_attachments.messageId SET price=0,attachments=0 WHERE mail_attachments.messageId IS NULL");
      DatabaseUtils.closeStatement(stmt);
      // чистим от мусора в mail_attachments, возвращая вещи владельцам
      stmt = con.createStatement();
      rs = stmt.executeQuery("SELECT itemId FROM mail_attachments LEFT JOIN mail ON mail.messageId = mail_attachments.messageId WHERE mail.messageId IS NULL");
      while(rs.next())
View Full Code Here

          returnItem(item);
        }
      }
      DatabaseUtils.closeDatabaseSR(stmt, rs);
      stmt = con.createStatement();
      stmt.executeUpdate("DELETE mail_attachments FROM mail_attachments LEFT JOIN mail ON mail.messageId = mail_attachments.messageId WHERE mail.messageId IS NULL");
      DatabaseUtils.closeStatement(stmt);
    }
    catch(SQLException e)
    {
      e.printStackTrace();
View Full Code Here

    FiltredStatement stmt = null;
    try
    {
      conn = L2DatabaseFactory.getInstance().getConnection();
      stmt = conn.createStatement();
      stmt.executeUpdate("UPDATE characters SET online = 0");
      stmt.executeUpdate("UPDATE characters SET accesslevel = 0 WHERE accesslevel = -1");
      _log.info("Clear characters online status and accesslevel.");
    }
    catch(SQLException e)
    {
View Full Code Here

    try
    {
      conn = L2DatabaseFactory.getInstance().getConnection();
      stmt = conn.createStatement();
      stmt.executeUpdate("UPDATE characters SET online = 0");
      stmt.executeUpdate("UPDATE characters SET accesslevel = 0 WHERE accesslevel = -1");
      _log.info("Clear characters online status and accesslevel.");
    }
    catch(SQLException e)
    {
    }
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.