Class SetExam

java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.SetExam

public class SetExam extends DAO
A Data Access Object to write Pilot Examinations and Check Rides to the database.
Since:
1.0
Version:
11.0
Author:
Luke
  • Constructor Details

    • SetExam

      public SetExam(Connection c)
      Initialize the Data Access Object.
      Parameters:
      c - the JDBC connection to use
  • Method Details

    • write

      public void write(Examination ex) throws DAOException
      Writes a new Pilot Examination to the database. This will update the database ID for the Examination bean with the automatically generated ID column value.
      Parameters:
      ex - the Examination to write
      Throws:
      DAOException - if a JDBC error occurs
    • update

      public void update(Examination ex) throws DAOException
      Updates an existing Pilot Examination in the database.
      Parameters:
      ex - the Examination to update
      Throws:
      DAOException - if a JDBC error occurs
    • write

      public void write(CheckRide cr) throws DAOException
      Writes a Check Ride to the database. This can handle inserts and updates.
      Parameters:
      cr - the Check Ride object
      Throws:
      DAOException - if a JDBC error occurs
    • linkCheckRide

      public void linkCheckRide(CheckRide cr) throws DAOException
      Links a CheckRide to a Flight Academy course.
      Parameters:
      cr - the CheckRide bean
      Throws:
      DAOException - if a JDBC error occurs
    • answer

      public void answer(int examID, Question q) throws DAOException
      Saves a single answer to an examination. This is used by a web service
      Parameters:
      examID - the Examination database ID
      q - the Question bean
      Throws:
      DAOException - if a JDBC error occurs
    • updateStats

      public void updateStats(Examination e) throws DAOException
      Updates Examination correct answer statistics.
      Parameters:
      e - the Examination bean
      Throws:
      DAOException - if a JDBC error occurs
    • deleteCheckRides

      public void deleteCheckRides(int courseID) throws DAOException
      Deletes unflown Check Rides from a Flight Academy Course.
      Parameters:
      courseID - the database ID of the Course
      Throws:
      DAOException - if a JDBC error occurs
    • delete

      public void delete(Test t) throws DAOException
      Deletes a Pilot Examination or Check Ride from the database.
      Parameters:
      t - the Examination/Checkride
      Throws:
      DAOException - if a JDBC error occurs