This commit is contained in:
Xephi59 2015-01-08 18:31:29 +01:00
parent fba07fa7e5
commit 1a499150c8

View File

@ -948,22 +948,24 @@ public class MySQLThread extends Thread implements DataSource {
public void setUnlogged(String user) { public void setUnlogged(String user) {
Connection con = null; Connection con = null;
PreparedStatement pst = null; PreparedStatement pst = null;
try { if (user != null)
con = makeSureConnectionIsReady(); try {
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE " + columnName + "=?;"); con = makeSureConnectionIsReady();
pst.setInt(1, 0); pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE " + columnName + "=?;");
pst.setString(2, user); pst.setInt(1, 0);
pst.executeUpdate(); pst.setString(2, user);
} catch (SQLException ex) { pst.executeUpdate();
ConsoleLogger.showError(ex.getMessage()); } catch (SQLException ex) {
return; ConsoleLogger.showError(ex.getMessage());
} catch (TimeoutException ex) { return;
ConsoleLogger.showError(ex.getMessage()); } catch (TimeoutException ex) {
return; ConsoleLogger.showError(ex.getMessage());
} finally { return;
close(pst); }
close(con); finally {
} close(pst);
close(con);
}
return; return;
} }