Package l2p.database

Examples of l2p.database.FiltredPreparedStatement


  public RecipeController()
  {
    _listByRecipeId = new HashMap<Integer, L2Recipe>();
    _listByRecipeItem = new HashMap<Integer, L2Recipe>();
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    FiltredPreparedStatement st2 = null;
    ResultSet list = null, rset2 = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM recipes");
      st2 = con.prepareStatement("SELECT * FROM `recitems` WHERE `rid`=?");
      list = statement.executeQuery();
      while(list.next())
      {
        Vector<L2RecipeComponent> recipePartList = new Vector<L2RecipeComponent>();
        boolean isDvarvenCraft = list.getBoolean("dwarven");
        String recipeName = list.getString("name");
        int id = list.getInt("id");
        int recipeId = list.getShort("recid");
        int level = list.getInt("lvl");
        short itemId = list.getShort("item");
        short foundation = list.getShort("foundation");
        short count = list.getShort("q");
        int mpCost = list.getInt("mp");
        int successRate = list.getInt("success");
        long exp = list.getLong("exp");
        long sp = list.getLong("sp");
        //material
        st2.setInt(1, id);
        rset2 = st2.executeQuery();
        while(rset2.next())
        {
          int rpItemId = rset2.getInt("item");
          int quantity = rset2.getInt("q");
          L2RecipeComponent rp = new L2RecipeComponent(rpItemId, quantity);
View Full Code Here


  private static GArray<L2Spawn> _Room2OutsideSpawnList = new GArray<L2Spawn>();

  public static void fill()
  {
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM lastimperialtomb_spawnlist");
      rset = statement.executeQuery();
      int npcTemplateId;
      L2Spawn spawnDat;
      L2NpcTemplate npcTemplate;
      while(rset.next())
      {
View Full Code Here

  }

  private static String addStatisticPvP()
  {
    ThreadConnection tc = null;
    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement("SELECT * FROM characters ORDER BY pvpkills DESC LIMIT 20;");
      rs = fps.executeQuery();
      StringBuilder sb = new StringBuilder();
      sb.append("<table width=650>");
      sb.append("<tr><td><center>ТОП 20 PVP");
      sb.append("<img src=L2UI.SquareWhite width=450 height=1>");
      sb.append("<table width=450 bgcolor=CCCCCC>");
View Full Code Here

  }

  private static String addStatisticPK()
  {
    ThreadConnection tc = null;
    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement("SELECT * FROM characters ORDER BY pkkills DESC LIMIT 20;");
      rs = fps.executeQuery();
      StringBuilder sb = new StringBuilder();
      sb.append("<table width=650>");
      sb.append("<tr><td><center>ТОП 20 PK");
      sb.append("<img src=L2UI.SquareWhite width=450 height=1>");
      sb.append("<table width=450 bgcolor=CCCCCC>");
View Full Code Here

  }

  private static String addStatisticNoble()
  {
    ThreadConnection tc = null;
    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement("SELECT cha.char_name, cha.sex, cha.onlinetime, cha.pkkills, cha.pvpkills, cha.online FROM characters cha, olympiad_nobles oly WHERE cha.obj_Id = oly.char_id ORDER BY cha.pvpkills DESC LIMIT 20");
      rs = fps.executeQuery();
      StringBuilder sb = new StringBuilder();
      sb.append("<table width=650>");
      sb.append("<tr><td><center>ТОП 20 Дворян");
      sb.append("<img src=L2UI.SquareWhite width=450 height=1>");
      sb.append("<table width=450 bgcolor=CCCCCC>");
View Full Code Here

  private static String addStatisticCastle()
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
    ThreadConnection tc = null;
    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement("SELECT * FROM castle ORDER BY id DESC LIMIT 10;");
      rs = fps.executeQuery();
      StringBuilder sb = new StringBuilder();
      sb.append("<table width=650>");
      sb.append("<tr><td><center>Статистика Замков");
      sb.append("<img src=L2UI.SquareWhite width=450 height=1>");
      sb.append("<table width=450 bgcolor=CCCCCC>");
View Full Code Here

  }

  private static String addStatisticClan()
  {
    ThreadConnection tc = null;
    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement("SELECT * FROM clan_data c WHERE c.clan_level > 0 ORDER BY c.clan_level DESC LIMIT 10;");
      rs = fps.executeQuery();
      StringBuilder sb = new StringBuilder();
      sb.append("<table width=650>");
      sb.append("<tr><td><center>Топ 10 Кланов");
      sb.append("<img src=L2UI.SquareWhite width=450 height=1>");
      sb.append("<table width=450 bgcolor=CCCCCC>");
View Full Code Here

  }

  private static String addStatisticFame()
  {
    ThreadConnection tc = null;
    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement("SELECT * FROM characters ORDER BY fame DESC LIMIT 20;");
      rs = fps.executeQuery();
      StringBuilder sb = new StringBuilder();
      sb.append("<table width=650>");
      sb.append("<tr><td><center>ТОП 20 Славы");
      sb.append("<img src=L2UI.SquareWhite width=450 height=1>");
      sb.append("<table width=450 bgcolor=CCCCCC>");
View Full Code Here

    {
      return false;
    }
    String cmd = "UPDATE characters SET x=-84318, y=244579, z=-3730 WHERE char_name=?";
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement(cmd);
      statement.setString(1, wordList[1]);
      statement.execute();
      DatabaseUtils.closeStatement(statement);
      statement = con.prepareStatement("SELECT obj_id FROM characters where char_name=?");
      statement.setString(1, wordList[1]);
      rset = statement.executeQuery();
      int objId = 0;
      if(rset.next())
      {
        objId = rset.getInt(1);
      }
      DatabaseUtils.closeDatabaseSR(statement, rset);
      if(objId == 0)
      {
        return false;
      }
      // con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM character_shortcuts WHERE char_obj_id=?");
      statement.setInt(1, objId);
      statement.execute();
      DatabaseUtils.closeStatement(statement);
      // con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE items SET loc='INVENTORY' WHERE owner_id=? AND loc!='WAREHOUSE'");
      statement.setInt(1, objId);
      statement.execute();
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

  public void restore()
  {
    final int OWNER = getOwner().getObjectId();
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM items WHERE owner_id=? AND (loc=? OR loc=?) ORDER BY object_id DESC");
      statement.setInt(1, OWNER);
      statement.setString(2, getBaseLocation().name());
      statement.setString(3, getEquipLocation().name());
      rset = statement.executeQuery();
      L2ItemInstance item, newItem;
      while(rset.next())
      {
        if((item = L2ItemInstance.restoreFromDb(rset, con, true)) == null)
        {
View Full Code Here

TOP

Related Classes of l2p.database.FiltredPreparedStatement

Copyright © 2018 www.massapicom. 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.