View difference between Paste ID: XWApz5vj and eFDxXB59
SHOW: | | - or go back to the newest paste.
1
    public void lbKD(CommandSender sender) {
2
	int count = 0;
3
	try {
4
	    sender.sendMessage(ChatColor.BLUE + "====" + ChatColor.GOLD + "Leaderboards - K/D" + ChatColor.BLUE + "====");
5
	    c = sql.getConnection();
6
	    s = c.createStatement();
7
	    rs = s.executeQuery("SELECT * FROM STATS ORDER BY KD DESC");
8-
	    while (count < 9) {
8+
	    while (count < 9 && rs.next()) {
9-
		while (rs.next()) {
9+
10
		    sender.sendMessage(ChatColor.GOLD + rs.getString(1) + ": K/D Ratio - " + rs.getInt(4) + " Kills- " + rs.getInt(2));
11
	    }
12-
		}
12+
13
	} catch (SQLException e) {
14
	    log.severe("[FWSkills] Error at leaderboards: " + e.getMessage());
15
	} finally {
16
	    sql.close(rs);
17
	    sql.close(s);
18
	    sql.close(c);
19
	}
20
    }