public int add(sols.Model.Exam exam){
        int generated_Exam_ID=-1;
        
        StringBuffer sql=new StringBuffer();
        sql.append("INSERT INTO Exam");
        sql.append("(`Exam_ID`,");
        sql.append("`Instructions`,");
        sql.append("`isPublic`)");
        sql.append("VALUES");
        sql.append("(null,");
        sql.append("'"+exam.getInstructions()+"',");
        if (exam.getIsPublic()) {
            sql.append("1);");
        }else{
            sql.append("0);");
        }
        
        
        SQLHelper sQLHelper=new SQLHelper();
        sQLHelper.sqlConnect();
        ResultSet rs=sQLHelper.runUpdate2(sql.toString());
        try {
            if (rs.next()) {
                generated_Exam_ID=rs.getInt(1);
            }
        } catch (SQLException ex) {
            Logger.getLogger(Subsection_DAO.class.getName()).log(Level.SEVERE, null, ex);
        }
        return generated_Exam_ID;
    }