Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Map<String, Integer> getTop(String value, int amount) {
- Map<String, Integer> top = new LinkedHashMap<String, Integer>();
- ResultSet resultSet = query("SELECT * FROM `players` ORDER BY " + value + " DESC LIMIT " + amount);
- try {
- while (resultSet.next()) {
- top.put(resultSet.getString("name"), resultSet.getInt(value));
- }
- } catch (SQLException ex) {
- ex.printStackTrace();
- }
- return top;
- }
Advertisement
Add Comment
Please, Sign In to add comment