X-Git-Url: https://harishankar.org/repos/?p=habeas.git;a=blobdiff_plain;f=src%2Fhabeas%2FUtility.java;fp=src%2Fhabeas%2FUtility.java;h=f36623bcee83613b61034af516e98c97063ac0db;hp=dd83144784df561e0a2a6224d48f06173ef8cb7e;hb=fdaede7966b1cfd8a38dcc51fa8ec60420b842b4;hpb=988965ad5c97f63eeb48b8e44a82cccb032bf591 diff --git a/src/habeas/Utility.java b/src/habeas/Utility.java index dd83144..f36623b 100644 --- a/src/habeas/Utility.java +++ b/src/habeas/Utility.java @@ -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 () {