Package l2p.gameserver.model.entity.siege.clanhall

Source Code of l2p.gameserver.model.entity.siege.clanhall.ClanHallSiegeDatabase

package l2p.gameserver.model.entity.siege.clanhall;

import l2p.database.DatabaseUtils;
import l2p.database.FiltredPreparedStatement;
import l2p.database.L2DatabaseFactory;
import l2p.database.ThreadConnection;
import l2p.gameserver.model.entity.siege.Siege;
import l2p.gameserver.model.entity.siege.SiegeDatabase;

public class ClanHallSiegeDatabase extends SiegeDatabase
{
  public ClanHallSiegeDatabase(Siege siege)
  {
    super(siege);
  }

  @Override
  public void saveSiegeDate()
  {
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE clanhall SET siegeDate = ? WHERE id = ?");
      statement.setLong(1, _siege.getSiegeDate().getTimeInMillis() / 1000);
      statement.setInt(2, _siege.getSiegeUnit().getId());
      statement.execute();
    }
    catch(Exception e)
    {
      System.out.println("Exception: saveSiegeDate(): " + e.getMessage());
      e.printStackTrace();
    }
    finally
    {
      DatabaseUtils.closeDatabaseCS(con, statement);
    }
  }
}
TOP

Related Classes of l2p.gameserver.model.entity.siege.clanhall.ClanHallSiegeDatabase

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.