Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. public boolean onLogin(connect) {
  2. try {
  3. conn = etc.getSQLConnection();
  4. player = new ArrayList<online>();
  5. ps = conn.prepareStatement("SELECT * FROM users");
  6. rs = ps.executeQuery();
  7.  
  8. while (rs.next()) {
  9. Group group = new Group();
  10. player.yes = rs.getBoolean("1");
  11. player.no = rs.getBoolean("0");
  12. player.ID = rs.getInt("id");
  13.  
  14. if (player.yes.length == 0)
  15. {
  16. //Updates the database field online in the users table mysql to 1
  17. }
  18.  
  19. } catch (SQLException ex) {
  20. log.log(Level.SEVERE, "User Online count not working hmm :(", ex);
  21. }
  22.  
  23. }
  24.  
  25. public boolean onDisconnect(connect) {
  26. try {
  27. conn = etc.getSQLConnection();
  28. player = new ArrayList<online>();
  29. ps = conn.prepareStatement("SELECT * FROM users");
  30. rs = ps.executeQuery();
  31.  
  32. while (rs.next()) {
  33. Group group = new Group();
  34. player.yes = rs.getBoolean("1");
  35. player.no = rs.getBoolean("0");
  36. player.ID = rs.getInt("id");
  37.  
  38. if (player.yes.length == 1)
  39. {
  40. //Updates the database field online in the users table mysql to 0
  41. }
  42.  
  43. } catch (SQLException ex) {
  44. log.log(Level.SEVERE, "User Online count not working hmm :(", ex);
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement