private void logIn(int personId) { Connection con = getConnect(); try { // MessageBox.infoBox("You have successfully logged in", "Login"); // INSERT INTO LogInOut (PersonId, TimeIn) VALUES (1, NOW()) String SQLLogin = "******" + personId + ", NOW())"; Statement stmtLogin = con.createStatement(); stmtLogin.executeUpdate(SQLLogin); Update_table(); } catch (SQLException err) { MessageBox.infoBox(err.toString(), "Error"); } closeConnect(); }
private void logOut(int personId) { Connection con = getConnect(); try { // MessageBox.infoBox("You have successfully logged out", "Logout"); // UPDATE LogInOut SET TimeOut = NOW() WHERE PersonId = 1 AND TimeOut IS NULL String SQLLogin = "******" + personId + " AND TimeOut IS NULL"; Statement stmtLogin = con.createStatement(); stmtLogin.executeUpdate(SQLLogin); Update_table(); } catch (SQLException err) { System.out.println(err); MessageBox.infoBox(err.toString(), "Error"); } closeConnect(); }
private void manualInputFocusGained( java.awt.event.FocusEvent evt) { // GEN-FIRST:event_manualInputFocusGained // TODO add your handling code here: Update_table(); } // GEN-LAST:event_manualInputFocusGained
private void formWindowOpened( java.awt.event.WindowEvent evt) { // GEN-FIRST:event_formWindowOpened // TODO add your handling code here: Update_table(); } // GEN-LAST:event_formWindowOpened