diff options
author | Ugnich Anton | 2012-11-02 17:32:20 +0700 |
---|---|---|
committer | Ugnich Anton | 2012-11-02 17:32:20 +0700 |
commit | 4c311735dcf5d6e54dfb1d2d751a2bd42193e168 (patch) | |
tree | 0b690f7ea4ded45d53e7e598cbc82c8edbc4d85b /src/com/juick/server/UserQueries.java | |
parent | 860b00003367e5a66ffc8ffe373542e424516249 (diff) |
getMessages
checkBL
Diffstat (limited to 'src/com/juick/server/UserQueries.java')
-rw-r--r-- | src/com/juick/server/UserQueries.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/juick/server/UserQueries.java b/src/com/juick/server/UserQueries.java index a49da34f..ff1d0e24 100644 --- a/src/com/juick/server/UserQueries.java +++ b/src/com/juick/server/UserQueries.java @@ -21,6 +21,7 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.ArrayList; import java.util.Random; /** @@ -278,6 +279,28 @@ public class UserQueries { return ret; } + public static ArrayList<Integer> checkBL(Connection sql, int visitor, ArrayList<Integer> uids) { + ArrayList<Integer> ret = new ArrayList<Integer>(); + + PreparedStatement stmt = null; + ResultSet rs = null; + try { + stmt = sql.prepareStatement("SELECT user_id FROM bl_users WHERE bl_user_id=? and user_id IN (" + Utils.convertArray2String(uids) + ")"); + stmt.setInt(1, visitor); + rs = stmt.executeQuery(); + rs.beforeFirst(); + while (rs.next()) { + ret.add(rs.getInt(1)); + } + } catch (SQLException e) { + System.err.println(e); + } finally { + Utils.finishSQL(rs, stmt); + } + + return ret; + } + public static boolean isSubscribed(Connection sql, int uid, int check) { boolean ret = false; |