Package l2p.database

Examples of l2p.database.ThreadConnection.createStatement()


        {
          FiltredStatement stcraft = null;
          ResultSet rstcraft = null;
          try
          {
            stcraft = con.createStatement();
            rstcraft = stcraft.executeQuery("SELECT `item_id`, `count` FROM `craftcount` WHERE `char_id`=" + objectId);
            player._StatCraft = new HashMap<Integer, Long>(32);
            while(rstcraft.next())
            {
              player._StatCraft.put(rstcraft.getInt("item_id"), rstcraft.getLong("count"));
View Full Code Here


    FiltredStatement fs = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      TextBuilder sb = TextBuilder.newInstance();
      fs = con.createStatement();
      for(L2NpcTemplate t : NpcTable.getAll())
      {
        if(t != null && t.killscount > 0)
        {
          fs.addBatch(sb.append("REPLACE INTO `killcount` SET `npc_id`=").append(t.npcId).append(", `count`=").append(t.killscount).append(", `char_id`=-1").toString());
View Full Code Here

    FiltredStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      rset = con.createStatement().executeQuery("SELECT * FROM `raidboss_status`");
      while(rset.next())
      {
        int id = rset.getInt("id");
        StatsSet info = new StatsSet();
        info.set("current_hp", rset.getDouble("current_hp"));
View Full Code Here

    ResultSet rset = null;
    try
    {
      //read raidboss points
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      rset = statement.executeQuery("SELECT owner_id, boss_id, points FROM `raidboss_points` ORDER BY owner_id ASC");
      int currentOwner = 0;
      FastMap<Integer, Integer> score = null;
      while(rset.next())
      {
View Full Code Here

    FiltredStatement statement = null;
    StringBuilder sb;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      SqlBatch b = new SqlBatch("INSERT INTO `raidboss_points` (owner_id, boss_id, points) VALUES");
      for(Entry<Integer, FastMap<Integer, Integer>> pointEntry : _points.entrySet())
      {
        FastMap<Integer, Integer> tmpPoint = pointEntry.getValue();
        if(tmpPoint == null || tmpPoint.isEmpty())
View Full Code Here

          //Restore drop stat
          FiltredStatement stdrop = null;
          ResultSet rstdrop = null;
          try
          {
            stdrop = con.createStatement();
            rstdrop = stdrop.executeQuery("SELECT `item_id`, `count` FROM `dropcount` WHERE `char_id`=" + objectId);
            player._StatDrop = new HashMap<Integer, Long>(128);
            while(rstdrop.next())
            {
              player._StatDrop.put(rstdrop.getInt("item_id"), rstdrop.getLong("count"));
View Full Code Here

        try
        {
          if(!fast && Config.KILL_COUNTER && _StatKills != null)
          {
            TextBuilder sb = TextBuilder.newInstance();
            fs = con.createStatement();
            for(Entry<Integer, Long> tmp : _StatKills.entrySet())
            {
              fs.addBatch(sb.append("REPLACE DELAYED INTO `killcount` SET `npc_id`=").append(tmp.getKey()).append(", `count`=").append(tmp.getValue()).append(", `char_id`=").append(_objectId).toString());
              sb.clear();
            }
View Full Code Here

            DatabaseUtils.closeStatement(fs);
          }
          if(!fast && Config.CRAFT_COUNTER && _StatCraft != null)
          {
            TextBuilder sb = TextBuilder.newInstance();
            fs = con.createStatement();
            for(Entry<Integer, Long> tmp : _StatCraft.entrySet())
            {
              fs.addBatch(sb.append("REPLACE DELAYED INTO `craftcount` SET `item_id`=").append(tmp.getKey()).append(", `count`=").append(tmp.getValue()).append(", `char_id`=").append(_objectId).toString());
              sb.clear();
            }
View Full Code Here

            DatabaseUtils.closeStatement(fs);
          }
          if(!fast && Config.DROP_COUNTER && _StatDrop != null)
          {
            TextBuilder sb = TextBuilder.newInstance();
            fs = con.createStatement();
            for(Entry<Integer, Long> tmp : _StatDrop.entrySet())
            {
              fs.addBatch(sb.append("REPLACE DELAYED INTO `craftcount` SET `item_id`=").append(tmp.getKey()).append(", `count`=").append(tmp.getValue()).append(", `char_id`=").append(_objectId).toString());
              sb.clear();
            }
View Full Code Here

    ThreadConnection con = null;
    FiltredStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      statement.executeUpdate("DELETE FROM character_skills_save WHERE char_obj_id = " + getObjectId() + " AND class_index=" + getActiveClassId() + " AND `end_time` < " + System.currentTimeMillis());
      if(skillReuseTimeStamps.isEmpty())
      {
        return;
      }
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.