update realName

This commit is contained in:
Xephi59
2015-08-03 18:37:42 +02:00
parent 50b41effa6
commit c1ffe47468
3 changed files with 16 additions and 2 deletions
@@ -70,6 +70,7 @@ public class CacheDataSource implements DataSource {
if (cache.containsKey(auth.getNickname())) {
cache.get(auth.getNickname()).setIp(auth.getIp());
cache.get(auth.getNickname()).setLastLogin(auth.getLastLogin());
cache.get(auth.getNickname()).setRealName(auth.getRealName());
}
return true;
}
@@ -517,10 +517,11 @@ public class MySQL implements DataSource {
PreparedStatement pst = null;
try {
con = makeSureConnectionIsReady();
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnIp + "=?, " + columnLastLogin + "=? WHERE LOWER(" + columnName + ")=?;");
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnIp + "=?, " + columnLastLogin + "=?, " + columnRealName + "=? WHERE LOWER(" + columnName + ")=?;");
pst.setString(1, auth.getIp());
pst.setLong(2, auth.getLastLogin());
pst.setString(3, auth.getNickname());
pst.setString(3, auth.getRealName());
pst.setString(4, auth.getNickname());
pst.executeUpdate();
} catch (SQLException ex) {
ConsoleLogger.showError(ex.getMessage());