From e2c257fecfd08e745c1f051bde14a32a43255f26 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Sun, 9 Mar 2014 01:13:17 +0700 Subject: setMessagePopular --- src/com/juick/server/MessagesQueries.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; + } } -- cgit v1.2.3