Advertisement
Guest User

Untitled

a guest
May 12th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public static boolean saveVotingPassword(String playerName, String password) {
  2. try {
  3. String query = "SELECT * FROM voting WHERE username LIKE '" + playerName+ "'";
  4. results = stmt.executeQuery(query);
  5. if (results.next()) {
  6. if (playerName.equalsIgnoreCase(results.getString("username"))) {
  7. if (results.getString("votepassword").length() < 5) {
  8. query("update voting set votepassword = '" + password + "' WHERE username = '" + playerName+ "'");
  9. }
  10. }
  11. }
  12. } catch (Exception e) {
  13. e.printStackTrace();
  14. return false;
  15. }
  16. return true;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement