Manage Legal Notices - View
[habeas.git] / src / habeas / Utility.java
index aac247c..0e6d9eb 100644 (file)
@@ -175,7 +175,9 @@ public class Utility {
         ArrayList<Object> notice = new ArrayList<>();
         try {
             Connection conn = DriverManager.getConnection(JDBC + connectionURL);
-            PreparedStatement st = conn.prepareStatement("SELECT * FROM legalnotices WHERE id=?;");
+            PreparedStatement st = conn.prepareStatement("SELECT legalnotices.*, clients.ClientName "
+                    + "FROM legalnotices "
+                    + "INNER JOIN clients WHERE ClientId=clients.id AND legalnotices.id=?;");
             st.setInt(1, selid);
             ResultSet rs = st.executeQuery();
             while (rs.next()) {
@@ -195,6 +197,7 @@ public class Utility {
                 notice.add (getValidDate (rs, "BillDate"));
                 notice.add (rs.getBoolean ("ClarificationPending"));
                 notice.add (rs.getString("ClarificationRemarks"));
+                notice.add (rs.getString("ClientName"));
             }
            return notice;
         } catch (SQLException ex) {