Probable fix for clan_privs SQLSyntaxErrorException.

This commit is contained in:
MobiusDevelopment
2019-07-31 18:45:30 +00:00
parent d302902d9d
commit ee451830f7
14 changed files with 28 additions and 43 deletions

View File

@@ -2021,14 +2021,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2057,7 +2056,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -1914,14 +1914,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -1950,7 +1949,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -1914,14 +1914,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -1950,7 +1949,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -1914,14 +1914,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -1950,7 +1949,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -1689,13 +1689,11 @@ public class Clan
try (Connection con = DatabaseFactory.getConnection()) try (Connection con = DatabaseFactory.getConnection())
{ {
PreparedStatement statement = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?"); PreparedStatement statement = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)");
statement.setInt(1, _clanId); statement.setInt(1, _clanId);
statement.setInt(2, rank); statement.setInt(2, rank);
statement.setInt(3, 0); statement.setInt(3, 0);
statement.setInt(4, privs); statement.setInt(4, privs);
statement.setInt(5, privs);
statement.execute(); statement.execute();
statement.close(); statement.close();
} }
@@ -1726,7 +1724,7 @@ public class Clan
try (Connection con = DatabaseFactory.getConnection()) try (Connection con = DatabaseFactory.getConnection())
{ {
PreparedStatement statement = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"); PreparedStatement statement = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)");
statement.setInt(1, _clanId); statement.setInt(1, _clanId);
statement.setInt(2, rank); statement.setInt(2, rank);
statement.setInt(3, 0); statement.setInt(3, 0);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2059,7 +2058,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);

View File

@@ -2022,14 +2022,13 @@ public class Clan implements IIdentifiable, INamable
_privs.get(rank).setPrivs(privs); _privs.get(rank).setPrivs(privs);
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);
ps.setInt(2, rank); ps.setInt(2, rank);
ps.setInt(3, 0); ps.setInt(3, 0);
ps.setInt(4, privs); ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute(); ps.execute();
} }
catch (Exception e) catch (Exception e)
@@ -2058,7 +2057,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs)); _privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)")) PreparedStatement ps = con.prepareStatement("REPLACE INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{ {
// Retrieve all skills of this PlayerInstance from the database // Retrieve all skills of this PlayerInstance from the database
ps.setInt(1, _clanId); ps.setInt(1, _clanId);