public static synchronized void saveNobleData(int nobleId)
{
L2Player player = L2ObjectsStorage.getPlayer(nobleId);
ThreadConnection con = null;
FiltredPreparedStatement statement = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
StatsSet nobleInfo = Olympiad._nobles.get(nobleId);
int classId = nobleInfo.getInteger(Olympiad.CLASS_ID);
String charName = player != null ? player.getName() : nobleInfo.getString(Olympiad.CHAR_NAME);
int points = nobleInfo.getInteger(Olympiad.POINTS);
int points_past = nobleInfo.getInteger(Olympiad.POINTS_PAST);
int points_past_static = nobleInfo.getInteger(Olympiad.POINTS_PAST_STATIC);
int compDone = nobleInfo.getInteger(Olympiad.COMP_DONE);
int compWin = nobleInfo.getInteger(Olympiad.COMP_WIN);
int compLoose = nobleInfo.getInteger(Olympiad.COMP_LOOSE);
statement = con.prepareStatement(Olympiad.OLYMPIAD_SAVE_NOBLES);
statement.setInt(1, nobleId);
statement.setInt(2, classId);
statement.setString(3, charName);
statement.setInt(4, points);
statement.setInt(5, points_past);
statement.setInt(6, points_past_static);
statement.setInt(7, compDone);
statement.setInt(8, compWin);
statement.setInt(9, compLoose);
statement.execute();
}
catch(Exception e)
{
Olympiad._log.warning("Olympiad System: Couldnt save noble info in db for player " + (player != null ? player.getName() : "null"));
e.printStackTrace();