diff options
author | 2014-04-04 14:57:42 +0700 | |
---|---|---|
committer | 2014-04-04 14:57:42 +0700 | |
commit | 3caf993af6742740f9c3997c8e072cc681b10118 (patch) | |
tree | 40ac97f0e07d7dd8e575343e19a7a70903d47472 /src/com/juick/server/TagQueries.java | |
parent | 2f56add386e112200dcbd7bdc3f6eefae4c1efb3 (diff) |
getBLUsers, getBLTags, setPopular
Diffstat (limited to 'src/com/juick/server/TagQueries.java')
-rw-r--r-- | src/com/juick/server/TagQueries.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/juick/server/TagQueries.java b/src/com/juick/server/TagQueries.java index 82c0f9ae..87704c62 100644 --- a/src/com/juick/server/TagQueries.java +++ b/src/com/juick/server/TagQueries.java @@ -95,4 +95,25 @@ public class TagQueries { } return tags; } + + public static ArrayList<String> getUserBLTags(Connection sql, int uid) { + ArrayList<String> tags = new ArrayList<String>(); + + PreparedStatement stmt = null; + ResultSet rs = null; + try { + stmt = sql.prepareStatement("SELECT tags.name FROM tags INNER JOIN bl_tags ON (bl_tags.user_id=? AND bl_tags.tag_id=tags.tag_id)"); + stmt.setInt(1, uid); + rs = stmt.executeQuery(); + rs.beforeFirst(); + while (rs.next()) { + tags.add(rs.getString(1)); + } + } catch (SQLException e) { + System.err.println(e); + } finally { + Utils.finishSQL(rs, stmt); + } + return tags; + } } |