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);
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
ps.setInt(1, _clanId);
ps.setInt(2, rank);
ps.setInt(3, 0);
ps.setInt(4, privs);
ps.setInt(5, privs);
ps.execute();
}
catch (Exception e)
@ -2057,7 +2056,7 @@ public class Clan implements IIdentifiable, INamable
_privs.put(rank, new RankPrivs(rank, 0, privs));
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
ps.setInt(1, _clanId);