Guest User

Untitled

a guest
Oct 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. Timer timer = null;
  2. if (timer == null) {
  3. timer = new Timer();
  4. TimerTask tarefa = new TimerTask() {
  5. @Override
  6. public void run() {
  7. try {
  8. listarmural(); //função que conecta no banco para
  9. //trazer informações
  10.  
  11. } catch (Exception e) {
  12. }
  13. }
  14. };
  15. timer.scheduleAtFixedRate(tarefa, TEMPO, TEMPO);`
  16.  
  17. while (rs.next()) {
  18. caixaTexto1.append("ID: " + rs.getString("idmural") + "nDATA: " + rs.getString("datahoramural") + "nTITULO: " + rs.getString("titulomural") + "nFILIAL: " + rs.getString("filial") + "nNOME: " + rs.getString("nome") + "nSTATUS: " + rs.getString("statusmural") + "nTEXTO: " + rs.getString("texto") + "n" + "_______________________________________________________________n");
  19. id = rs.getString("idmural");
  20. }
  21. //Notifica quando for incluído um novo mural
  22. if (id == null) {
  23. //quando não houver
  24. } else {
  25. idatual = Integer.parseInt(id);
  26.  
  27. if (idatual > id1) {
  28. botao1.doClick();
  29. id1 = idatual;
  30. }
  31. }
  32. desconecta1();
  33. }`
Add Comment
Please, Sign In to add comment