diff options
author | 2014-03-09 01:13:17 +0700 | |
---|---|---|
committer | 2014-03-09 01:13:17 +0700 | |
commit | e2c257fecfd08e745c1f051bde14a32a43255f26 (patch) | |
tree | 28e2adddb1b001facba4f91366aecfc37a2cb206 /src/com/juick/server/MessagesQueries.java | |
parent | ae4f9f1759dafdc1bf57e043450970794954324d (diff) |
setMessagePopular
Diffstat (limited to 'src/com/juick/server/MessagesQueries.java')
-rw-r--r-- | src/com/juick/server/MessagesQueries.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/juick/server/MessagesQueries.java b/src/com/juick/server/MessagesQueries.java index 3dd8418b..fa84f476 100644 --- a/src/com/juick/server/MessagesQueries.java +++ b/src/com/juick/server/MessagesQueries.java @@ -884,4 +884,22 @@ public class MessagesQueries { return replies; } + + public static boolean setMessagePopular(Connection sql, int mid, int popular) { + boolean ret = false; + + PreparedStatement stmt = null; + try { + stmt = sql.prepareStatement("UPDATE messages SET popular=? WHERE message_id=?"); + stmt.setInt(1, popular); + stmt.setInt(2, mid); + ret = stmt.executeUpdate() > 0; + } catch (SQLException e) { + System.err.println(e); + } finally { + Utils.finishSQL(null, stmt); + } + + return ret; + } } |