I have the following question in Java: how can I pass to SQL that it should capture the "date and time" of the computer and update the User Table in PostGreSQL?
Follow the code below:
public class UsuarioAtualizar {
private Connection con = ConectarDB.getConexao();
private dao.UsuarioD daoUsuario = new dao.UsuarioD();
public void updateClienteByCpf(model.UsuarioM usuario){
// Variáveis
PreparedStatement ps = null;
String sql = "update usuario set timestamp=?";
// Inserção
try {
ps = con.prepareStatement(sql);
//ps.setString(1, usuario.getNome());
ps.executeUpdate();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
public dao.UsuarioD getDaoUsuario() {
return daoUsuario;
}
public void setDaoUsuario(dao.UsuarioD daoUsuario) {
this.daoUsuario = daoUsuario;
}
}