Manage Legal Notices - Description
[habeas.git] / src / habeas / Utility.java
index dd83144..f36623b 100644 (file)
@@ -206,7 +206,7 @@ public class Utility {
     }
     private static final String JDBC = "jdbc:sqlite:";
 
-    static boolean updateLegalNoticeDraftStatus(int selectednotice_id, boolean created, boolean approved) {
+    static boolean updateNoticeDraftStatus(int selectednotice_id, boolean created, boolean approved) {
         try {
             Connection conn = DriverManager.getConnection(JDBC + connectionURL);
             PreparedStatement st = conn.prepareStatement("UPDATE legalnotices "
@@ -222,6 +222,23 @@ public class Utility {
             return false;
         }
         
+    }
+
+    static boolean updateNoticeDescription(int selectednotice_id, String text) {
+        try {
+            Connection conn = DriverManager.getConnection(JDBC + connectionURL);
+            PreparedStatement st = conn.prepareStatement("UPDATE legalnotices "
+                    + "SET Description=? WHERE id=?;");
+            st.setString(1, text);
+            st.setInt(2, selectednotice_id);
+            st.execute();
+            conn.close();
+            return true;
+        } catch (SQLException ex) {
+            Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
+            return false;
+        }
+        
     }
     public Utility () {