Guest User

Untitled

a guest
Jan 19th, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public Map<String, Integer> getTop(String value, int amount) {
  2. Map<String, Integer> top = new LinkedHashMap<String, Integer>();
  3. ResultSet resultSet = query("SELECT * FROM `players` ORDER BY " + value + " DESC LIMIT " + amount);
  4. try {
  5. while (resultSet.next()) {
  6. top.put(resultSet.getString("name"), resultSet.getInt(value));
  7. }
  8. } catch (SQLException ex) {
  9. ex.printStackTrace();
  10. }
  11. return top;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment