From bde1bae2a20811cb650608b49459c18f837ba9a5 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Sun, 14 Oct 2012 11:51:31 +0700 Subject: getMessageRecommendations ArrayList --- src/com/juick/server/MessagesQueries.java | 11 ++++------- 1 file 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 getMessageRecommendations(Connection sql, int mid) { + ArrayList users = new ArrayList(); 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 += "@" + rs.getString(1) + ""; + 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 getAll(Connection sql, int before) { -- cgit v1.2.3