Manage Legal Notices - Bill Details
[habeas.git] / src / habeas / Utility.java
index 4a4042c..2d2caca 100644 (file)
@@ -272,6 +272,26 @@ public class Utility {
             Date sqldate = new Date (date.getTime()/1000);
             return sqldate;
     }
+
+    static boolean updateNoticeBillDetails(int selid, String bill_status, 
+            java.util.Date bill_date, int bill_amount) {
+        try {
+            Connection conn = DriverManager.getConnection(JDBC + connectionURL);
+            PreparedStatement st = conn.prepareStatement("UPDATE legalnotices"
+                    + " SET BillStatus=?,BillDate=?,BillAmount=? WHERE id=?;");
+            st.setString (1, bill_status);
+            st.setDate(2, toSqlDate(bill_date));
+            st.setInt(3, bill_amount);
+            st.setInt(4, selid);
+            st.execute();
+            conn.close();
+            return true;
+        } catch (SQLException ex) {
+            Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
+            return false;
+        }
+        
+    }
     public Utility () {
         
     }