aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/server
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-03-09 01:13:17 +0700
committerGravatar Ugnich Anton2014-03-09 01:13:17 +0700
commite2c257fecfd08e745c1f051bde14a32a43255f26 (patch)
tree28e2adddb1b001facba4f91366aecfc37a2cb206 /src/com/juick/server
parentae4f9f1759dafdc1bf57e043450970794954324d (diff)
setMessagePopular
Diffstat (limited to 'src/com/juick/server')
-rw-r--r--src/com/juick/server/MessagesQueries.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/juick/server/MessagesQueries.java b/src/com/juick/server/MessagesQueries.java
index 3dd8418bd..fa84f4763 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;
+ }
}