Interface CourseDAO

All Known Implementing Classes:
CourseDAOImpl

public interface CourseDAO
Data Access Object interface for managing Course entities in the database.
  • Method Summary

    Modifier and Type
    Method
    Description
    findByDepartmentId(int departmentId)
    Finds all courses associated with a specific department.
    Finds a course by its title.
    void
    save(Course course)
    Saves a course to the database.
    void
    update(Course course)
    Updates an existing course in the database.
  • Method Details

    • save

      void save(Course course) throws SQLException
      Saves a course to the database. The course's ID will be automatically generated by the database and set on the object.
      Parameters:
      course - the course to save
      Throws:
      SQLException - if a database error occurs
    • findByTitle

      Finds a course by its title.
      Parameters:
      title - the title to search for
      Returns:
      the course with the given title, or null if not found
      Throws:
      SQLException - if a database error occurs
    • findByDepartmentId

      List<Course> findByDepartmentId(int departmentId) throws SQLException
      Finds all courses associated with a specific department.
      Parameters:
      departmentId - the department ID to search for
      Returns:
      a list of courses in the department
      Throws:
      SQLException - if a database error occurs
    • update

      void update(Course course) throws SQLException
      Updates an existing course in the database. Uses the course's ID to identify which record to update.
      Parameters:
      course - the course to update
      Throws:
      SQLException - if a database error occurs