diff options
author | Ugnich Anton | 2012-10-14 11:51:31 +0700 |
---|---|---|
committer | Ugnich Anton | 2012-10-14 11:51:31 +0700 |
commit | bde1bae2a20811cb650608b49459c18f837ba9a5 (patch) | |
tree | 4005fcb08c26b6fc7e274927b5c0bba608c5d199 /src/com | |
parent | 6df2be1e680adb8f9c8a186fae05dd7357280c95 (diff) |
getMessageRecommendations ArrayList
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/juick/server/MessagesQueries.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/com/juick/server/MessagesQueries.java b/src/com/juick/server/MessagesQueries.java index 3ec412b0..80d7a280 100644 --- a/src/com/juick/server/MessagesQueries.java +++ b/src/com/juick/server/MessagesQueries.java @@ -160,8 +160,8 @@ public class MessagesQueries { return user; } - public static String getMessageRecommendations(Connection sql, int mid) { - String ret = ""; + public static ArrayList<String> getMessageRecommendations(Connection sql, int mid) { + ArrayList<String> users = new ArrayList<String>(); PreparedStatement stmt = null; ResultSet rs = null; @@ -171,10 +171,7 @@ public class MessagesQueries { rs = stmt.executeQuery(); rs.beforeFirst(); while (rs.next()) { - if (!ret.isEmpty()) { - ret += ", "; - } - ret += "<a href=\"/" + rs.getString(1) + "/\">@" + rs.getString(1) + "</a>"; + users.add(rs.getString(1)); } } catch (SQLException e) { System.err.println(e); @@ -182,7 +179,7 @@ public class MessagesQueries { Utils.finishSQL(rs, stmt); } - return ret; + return users; } public static ArrayList<Integer> getAll(Connection sql, int before) { |