Package Database

Class ContactDataAccessObject

java.lang.Object
Database.ContactDataAccessObject

public class ContactDataAccessObject extends Object
Class representing all the methods to query the contacts table
  • Constructor Details

    • ContactDataAccessObject

      public ContactDataAccessObject()
  • Method Details

    • getContactByContactID

      public static Contact getContactByContactID(int _contactId) throws SQLException
      This function queries a contact
      Parameters:
      _contactId - the contactID int value
      Returns:
      the Contact object
      Throws:
      SQLException
    • getAllContacts

      public static javafx.collections.ObservableList<Contact> getAllContacts() throws SQLException
      This function queries a list of contacts
      Returns:
      [ObservableList] of Contact objects
      Throws:
      SQLException
    • getContactByEmail

      public static javafx.collections.ObservableList<Contact> getContactByEmail(int _email) throws SQLException
      This function queries a list of contacts
      Parameters:
      _email - the email string value
      Returns:
      [ObservableList] of Contact objects
      Throws:
      SQLException
    • deleteContactByContactID

      public static void deleteContactByContactID(int _contactId) throws SQLException
      This function deletes a contact record
      Parameters:
      _contactId - the contactID int value
      Throws:
      SQLException
    • deleteContactByDivisionID

      public static void deleteContactByDivisionID(int _email) throws SQLException
      This function deletes a contact record
      Parameters:
      _email - the email string value
      Throws:
      SQLException
    • addContact

      public static void addContact(Contact _contact)
      This function adds a contact record
      Parameters:
      _contact - the Contact object
    • updateContact

      public static void updateContact(Contact _contact)
      This function update a contact record
      Parameters:
      _contact - the Contact object