Package l2p.database

Examples of l2p.database.FiltredPreparedStatement.executeUpdate()


          // Restore the karma
          statement = con.prepareStatement("UPDATE characters SET karma=?, pkkills=? WHERE obj_Id=?");
          statement.setInt(1, cw.getPlayerKarma());
          statement.setInt(2, cw.getPlayerPkKills());
          statement.setInt(3, cw.getPlayerId());
          statement.executeUpdate();
        }
        catch(SQLException e)
        {
          _log.warning("CursedWeaponsManager: Could not delete : " + e);
        }
View Full Code Here


      {
        con = L2DatabaseFactory.getInstance().getConnection();
        // Delete previous datas
        statement = con.prepareStatement("DELETE FROM cursed_weapons WHERE item_id = ?");
        statement.setInt(1, cw.getItemId());
        statement.executeUpdate();
        DatabaseUtils.closeStatement(statement);
        statement = null;
        if(cw.isActive())
        {
          statement = con.prepareStatement("REPLACE INTO cursed_weapons (item_id, player_id, player_karma, player_pkkills, nb_kills, x, y, z, end_time) VALUES (?,?,?,?,?,?,?,?,?)");
View Full Code Here

          statement.setInt(5, cw.getNbKills());
          statement.setInt(6, cw.getLoc().x);
          statement.setInt(7, cw.getLoc().y);
          statement.setInt(8, cw.getLoc().z);
          statement.setLong(9, cw.getEndTime() / 1000);
          statement.executeUpdate();
        }
      }
      catch(SQLException e)
      {
        _log.severe("CursedWeapon: Failed to save data: " + e);
View Full Code Here

        if(csi.isLimited())
        {
          statement = con.prepareStatement("UPDATE item_mall set iStock=? where ord=?");
          statement.setInt(1, csi.iStock);
          statement.setInt(2, csi.order);
          statement.executeUpdate();
          statement.close();
        }
      }
    }
    catch(final Exception e)
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE character_cash set cash=? where char_obj_id=? and char_name=?");
      statement.setInt(1, cash - price);
      statement.setInt(2, player.getObjectId());
      statement.setString(3, player.getName());
      statement.executeUpdate();
      statement.close();
      }
      catch(final Exception e)
      {
        _log.warning("mOption: error in price() " + e);
View Full Code Here

      {
        con = L2DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement(SQL_STATEMENTS[1]);
        statement.setLong(1, _lastActivation / 1000);
        statement.setInt(2, _id);
        statement.executeUpdate();
      }
      catch(SQLException e)
      {
        _log.warning("cannot updated the Global Task " + _id + ": " + e.getMessage());
      }
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("INSERT INTO gameservers (hexid,server_id,host) values (?,?,?)");
      statement.setString(1, hexToString(hexId));
      statement.setInt(2, id);
      statement.setString(3, externalHost);
      statement.executeUpdate();
    }
    catch(SQLException e)
    {
      _log.warning("SQL error while saving gameserver: " + e);
    }
View Full Code Here

      statement.setLong(19, player.getNoChannel() > 0 ? player.getNoChannel() / 1000 : player.getNoChannel());
      statement.setInt(20, player.getPledgeType());
      statement.setInt(21, player.getPowerGrade());
      statement.setInt(22, player.getLvlJoinedAcademy());
      statement.setInt(23, player.getApprentice());
      statement.executeUpdate();
      DatabaseUtils.closeStatement(statement);
      statement = con.prepareStatement("INSERT INTO character_subclasses (char_obj_id, class_id, exp, sp, curHp, curMp, curCp, maxHp, maxMp, maxCp, level, active, isBase, death_penalty, skills) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      statement.setInt(1, player.getObjectId());
      statement.setInt(2, player.getTemplate().classId.getId());
      statement.setInt(3, 0);
View Full Code Here

      statement.setInt(11, 1);
      statement.setInt(12, 1);
      statement.setInt(13, 1);
      statement.setInt(14, 0);
      statement.setString(15, "");
      statement.executeUpdate();
      DatabaseUtils.closeStatement(statement);
      //CashShop database creation for new L2Player
      if(Config.itemmallType == 1)
      {
      statement = con.prepareStatement("INSERT INTO character_cash (char_obj_id, char_name, cash) VALUES (?,?,?)");
View Full Code Here

      {
      statement = con.prepareStatement("INSERT INTO character_cash (char_obj_id, char_name, cash) VALUES (?,?,?)");
      statement.setInt(1, player.getObjectId());
      statement.setString(2, player.getName());
      statement.setInt(3, 0);
      statement.executeUpdate();
      DatabaseUtils.closeStatement(statement);
      }
    }
    catch(final 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.