public void setAllianceId(int a) {
        this.allianceid = a;
        try {
            Connection con = DatabaseConnection.getConnection();
            try (PreparedStatement ps = con.prepareStatement("UPDATE guilds SET alliance = ? WHERE guildid = ?")) {
                ps.setInt(1, a);
                ps.setInt(2, id);
                ps.execute();
            }
        } catch (SQLException e) {
            System.err.println("Saving allianceid ERROR" + e);
        }
    }