Class SetExamQuestion

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

public class SetExamQuestion extends DAO
A Data Access Object to write Examination Question profiles to the database.
Since:
3.6
Version:
11.0
Author:
Luke
  • Constructor Details

    • SetExamQuestion

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

    • write

      public void write(QuestionProfile qp) throws DAOException
      Writes an Examination Question Profile to the database. This call can handle both INSERT and UPDATE operations. If an INSERT operation is performed, the auto-assigned database ID will be set in the bean.
      Parameters:
      qp - the QuestionProfile bean to write
      Throws:
      DAOException - if a JDBC error occurs
    • writeExams

      public void writeExams(QuestionProfile qp) throws DAOException
      Updates the Examinations that can use this Question.
      Parameters:
      qp - the QuestionProfile bean
      Throws:
      DAOException - if a JDBC error occurs
    • writeImage

      public void writeImage(QuestionProfile qp) throws DAOException
      Writes a Question Profile image resource to the database.
      Parameters:
      qp - the QuestionProfile bean
      Throws:
      DAOException - if a JDBC error occurs
      IllegalArgumentException - if the Image bean is not populated
    • clearImage

      public void clearImage(int id) throws DAOException
      Deletes a Question Profile image resource from the database.
      Parameters:
      id - the Question Profile database ID
      Throws:
      DAOException - if a JDBC error occurs
    • delete

      public void delete(QuestionProfile qp) throws DAOException
      Deletes an Examination Question profile from the database.
      Parameters:
      qp - the QuestionProfile bean
      Throws:
      DAOException - if a JDBC error occurs