Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. try {
  2. System.out.println("Successful connecting to database2!");
  3. if (!connect(HOST, DATABASE, USER, PASS)) {
  4. return;
  5. }
  6. System.out.println("Successful connecting to database3!");
  7.  
  8. String name = player.getUsername().replace("_", " ");
  9. System.out.println("Successful connecting to database4!");
  10. ResultSet rs = executeQuery("SELECT * FROM payments WHERE player_name='" + name + "' AND status='Completed' AND claimed=0");
  11. System.out.println("Successful connecting to database5!");
  12.  
  13. while (rs.next()) {
  14. System.out.println("Successful connecting to database6!");
  15. int item_number = rs.getInt("item_number");
  16. double paid = rs.getDouble("amount");
  17. int quantity = rs.getInt("quantity");
  18.  
  19. System.out.println("Successful connecting to database7!");
  20. switch (item_number) {// add products according to their ID in the ACP
  21.  
  22. case 18: // example
  23. System.out.println("Claiming " + paid);
  24. player.getInventory().addItem(11696, quantity);
  25. break;
  26.  
  27. }
  28.  
  29. System.out.println("Attempting to claim");
  30. //rs.updateInt("claimed", 1); // do not delete otherwise they can reclaim!
  31. rs.updateRow();
  32. }
  33. destroy();
  34. } catch (Exception e) {
  35. e.printStackTrace();
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement