public void inStamp(String userAbrev) { ip = remoteAddr; if (id > 0) { return; } // assegura que només es crida un pic a la subrutina String SQL1 = "INSERT INTO sig_log (usua, ip, netbios, domain, tasca, inici) VALUES(?,?,?,?,?,NOW())"; Object[] obj = new Object[] {userAbrev, remoteAddr, remoteHost, "", "PDAWEB"}; id = mysql.preparedUpdateID(SQL1, obj); }
public int outStamp() { if (id == 0) { return -1; } String SQL1 = "UPDATE sig_log SET fi=NOW(), resultat=? where id=?"; String txt = ip + ": " + actions.toString(); Object[] obj = new Object[] {txt, id}; int nup = mysql.preparedUpdate(SQL1, obj); return nup; // id=0;//assegura que només es crida un pic a la subrutina }