Package l2p.database

Examples of l2p.database.ThreadConnection.prepareStatement()


    Calendar end_;
    end_ = Calendar.getInstance();
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      offline = con.prepareStatement("SELECT bonus_expire_time FROM bonus WHERE obj_id LIKE ? AND bonus_name = ?");
      offline.setInt(1, player.getObjectId());
      offline.setString(2, type);
      rs = offline.executeQuery();
      if(rs.next())
      {
View Full Code Here


    }
    bonus_expire.add(Calendar.DAY_OF_MONTH, Config.SERVICES_RATE_SPECIAL_DAYS);
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      offline = con.prepareStatement("INSERT INTO bonus(obj_id, bonus_name, bonus_value, bonus_expire_time) VALUES (?,?,?,?)");
      offline.setInt(1, player.getObjectId());
      offline.setString(2, bonus_class);
      offline.setInt(3, Config.SERVICES_RATE_SPECIAL_RATE);
      offline.setLong(4, bonus_expire.getTimeInMillis() / 1000);
      offline.executeUpdate();
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT friend_id FROM character_friends WHERE char_id=?");
      statement.setInt(1, ptarget.getObjectId());
      rset = statement.executeQuery();
      while(rset.next())
      {
        objectId = rset.getInt("friend_id");
View Full Code Here

    FiltredPreparedStatement statement1 = null;
    ResultSet rset1 = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement1 = con.prepareStatement("SELECT DISTINCT key_npc_id FROM four_sepulchers_spawnlist WHERE spawntype = ? ORDER BY key_npc_id");
      statement1.setInt(1, type);
      rset1 = statement1.executeQuery();
      while(rset1.next())
      {
        int keyNpcId = rset1.getInt("key_npc_id");
View Full Code Here

        int keyNpcId = rset1.getInt("key_npc_id");
        FiltredPreparedStatement statement2 = null;
        ResultSet rset2 = null;
        try
        {
          statement2 = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist WHERE key_npc_id = ? AND spawntype = ? ORDER BY id");
          statement2.setInt(1, keyNpcId);
          statement2.setInt(2, type);
          rset2 = statement2.executeQuery();
          GArray<Location> locations = new GArray<Location>();
          while(rset2.next())
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist WHERE spawntype = 0 ORDER BY id");
      rset = statement.executeQuery();
      while(rset.next())
      {
        _mysteriousBoxSpawns.put(rset.getInt("key_npc_id"), new Location(rset.getInt("locx"), rset.getInt("locy"), rset.getInt("locz"), rset.getInt("heading"), rset.getInt("npc_templateid")));
      }
View Full Code Here

    try
    {
      removeItem(player, 13015, 1);
      player.logout(false, false, false, true);
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE characters SET bookmarks = bookmarks+3 WHERE obj_Id=?");
      statement.setInt(1, player.getObjectId());
      statement.execute();
      DatabaseUtils.closeStatement(statement);
      //player.updateStats();
      //player.sendChanges();
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement offline = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      offline = con.prepareStatement("UPDATE characters SET sex = ? WHERE obj_Id = ?");
      offline.setInt(1, player.getSex() == 1 ? 0 : 1);
      offline.setInt(2, player.getObjectId());
      offline.executeUpdate();
    }
    catch(Exception e)
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT objId, name, level, curHp, curMp, exp, sp, fed FROM pets WHERE item_obj_id=?");
      statement.setInt(1, control.getObjectId());
      rset = statement.executeQuery();
      L2PetInstance pet;
      if(!rset.next())
      {
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM pets WHERE item_obj_id=?");
      statement.setInt(1, getControlItemObjId());
      statement.execute();
    }
    catch(Exception 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.