Tamu Grade Analyzer
Analyzes the grade distribution of Texas A&M professors
Public Member Functions | Static Public Member Functions | List of all members
DatabaseAPI Class Reference

Public Member Functions

void createDBConn () throws SQLException, ClassNotFoundException
 
int getNumberA ()
 
int getNumberB ()
 
int getNumberC ()
 
int getNumberD ()
 
int getNumberF ()
 
int getNumberQ ()
 
double getAverageGPA ()
 
int getTotalNumStudents ()
 
double getPercentageA ()
 
double getPercentageB ()
 
double getPercentageC ()
 
double getPercentageD ()
 
double getPercentageF ()
 
double getPercentageQ ()
 
String getCourseSubject ()
 
int getCourseNum ()
 
String getProfessor ()
 
ArrayList< String > getSubjects ()
 
ArrayList< String > getAllSubjectDistinctList () throws SQLException
 
ArrayList< Integer > getAllCourseNumDistinct (String courseSubject) throws SQLException
 
ArrayList< String > getCourseProfessors (String courseSubject, int courseNum) throws SQLException
 
int getNumASem (String courseSubject, int courseNum, String professor, String term, int year) throws SQLException
 
int getNumBSem (String courseSubject, int courseNum, String professor, String term, int year) throws SQLException
 
int getNumCSem (String courseSubject, int courseNum, String professor, String term, int year) throws SQLException
 
int getNumDSem (String courseSubject, int courseNum, String professor, String term, int year) throws SQLException
 
int getNumFSem (String courseSubject, int courseNum, String professor, String term, int year) throws SQLException
 
int getNumA (String courseSubject, int courseNum, String professor) throws SQLException
 
int getNumB (String courseSubject, int courseNum, String professor) throws SQLException
 
int getNumC (String courseSubject, int courseNum, String professor) throws SQLException
 
int getNumD (String courseSubject, int courseNum, String professor) throws SQLException
 
int getNumF (String courseSubject, int courseNum, String professor) throws SQLException
 
int getNumQDrop (String courseSubject, int courseNum, String professor) throws SQLException
 
double getAvgGPA (String courseSubject, int courseNum, String professor) throws SQLException
 
int getTotalNumStudentsTaught (String courseSubject, int courseNum, String professor) throws SQLException
 
double getPercentA (String courseSubject, int courseNum, String professor) throws SQLException
 
double getPercentB (String courseSubject, int courseNum, String professor) throws SQLException
 
double getPercentC (String courseSubject, int courseNum, String professor) throws SQLException
 
double getPercentD (String courseSubject, int courseNum, String professor) throws SQLException
 
double getPercentF (String courseSubject, int courseNum, String professor) throws SQLException
 
double getPercentQDrops (String courseSubject, int courseNum, String professor) throws SQLException
 
double getAvgGPASem (String courseSubject, int courseNum, String professor, String term, int year) throws SQLException
 
ArrayList< Double > getPastSemesterGPAs (String courseSubject, int courseNum, String professor) throws SQLException
 
ArrayList< String > getPastSemesters (String courseSubject, int courseNum, String professor) throws SQLException
 
int getNumSemestersTaught (String subject, int courseNum, String professor) throws SQLException
 
ArrayList< String > getProfRawData (String subject, int courseNum, String professor) throws SQLException
 
void insert (String Subject, int courseNum, int sectionNum, Double avgGPA, String professor, int numA, int numB, int numC, int numD, int numF, int numQdrop, String termSemester, int termYear, boolean honors)
 
void closeDBConn () throws SQLException
 

Static Public Member Functions

static void main (String[] args)
 

Member Function Documentation

ArrayList<Integer> DatabaseAPI.getAllCourseNumDistinct ( String  courseSubject) throws SQLException

returns an arraylist of all course numbers under a specific subject

Parameters
courseSubject
Returns
allCourseNums which are all of the courseNumbers for that subject
Exceptions
SQLException
ArrayList<String> DatabaseAPI.getAllSubjectDistinctList ( ) throws SQLException

returns an arraylist of all subjects in database in alphabetical order.

Returns
allSubjects which is an arraylist of all of the subjects in the database
Exceptions
SQLException
double DatabaseAPI.getAvgGPA ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

calculates the average GPA for the professor of this subject and course independently of the this class.

Parameters
courseSubject
courseNum
professor
Returns
totalPoints which is the average GPA
Exceptions
SQLException
double DatabaseAPI.getAvgGPASem ( String  courseSubject,
int  courseNum,
String  professor,
String  term,
int  year 
) throws SQLException

If there is no result for a year, the function just returns zero Calculates the average GPA for a class for a specific semester

Parameters
courseSubject
courseNum
professor
term
year
Returns
Exceptions
SQLException
ArrayList<String> DatabaseAPI.getCourseProfessors ( String  courseSubject,
int  courseNum 
) throws SQLException

Returns an arraylist of the professors in alphabetical order

Parameters
courseSubject
courseNum
Returns
allCourseProfessors which are all of the professors listed for this course
Exceptions
SQLException
int DatabaseAPI.getNumA ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

counts total number of A's given by a professor in a specific subject and course number. However, this one is just in case I need a random SQL query and can't re-setup the class

Parameters
courseSubject
courseNum
professor
Returns
totalNumA which is the number of A's for the course
Exceptions
SQLException
int DatabaseAPI.getNumASem ( String  courseSubject,
int  courseNum,
String  professor,
String  term,
int  year 
) throws SQLException

gets the number of A's for a class for a certain semester and year

Parameters
courseSubject
courseNum
professor
term
year
Returns
totalNumA which is the number of A's for that semester
Exceptions
SQLException
int DatabaseAPI.getNumB ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

counts total number of B's given by a professor in a specific subject and course number. However, this one is just in case I need a random SQL query and can't re-setup the class

Parameters
courseSubject
courseNum
professor
Returns
totalNumB which is the number of B's for the course
Exceptions
SQLException
int DatabaseAPI.getNumBSem ( String  courseSubject,
int  courseNum,
String  professor,
String  term,
int  year 
) throws SQLException

gets the number of B's for a class for a certain semester and year

Parameters
courseSubject
courseNum
professor
term
year
Returns
totalNumB which is the number of B's for that semester
Exceptions
SQLException
int DatabaseAPI.getNumC ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

counts total number of C's given by a professor in a specific subject and course number. However, this one is just in case I need a random SQL query and can't re-setup the class

Parameters
courseSubject
courseNum
professor
Returns
totalNumC which is the number of C's for the course
Exceptions
SQLException
int DatabaseAPI.getNumCSem ( String  courseSubject,
int  courseNum,
String  professor,
String  term,
int  year 
) throws SQLException

gets the number of C's for a class for a certain semester and year

Parameters
courseSubject
courseNum
professor
term
year
Returns
totalNumC which is the number of C's for that semester
Exceptions
SQLException
int DatabaseAPI.getNumD ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

counts total number of D's given by a professor in a specific subject and course number. However, this one is just in case I need a random SQL query and can't re-setup the class

Parameters
courseSubject
courseNum
professor
Returns
totalNumD which is the number of D's for the course
Exceptions
SQLException
int DatabaseAPI.getNumDSem ( String  courseSubject,
int  courseNum,
String  professor,
String  term,
int  year 
) throws SQLException

gets the number of D's for a class for a certain semester and year

Parameters
courseSubject
courseNum
professor
term
year
Returns
totalNumD which is the number of D's for that semester
Exceptions
SQLException
int DatabaseAPI.getNumF ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

counts total number of F's given by a professor in a specific subject and course number. However, this one is just in case I need a random SQL query and can't re-setup the class

Parameters
courseSubject
courseNum
professor
Returns
totalNumF which is the number of F's for the course
Exceptions
SQLException
int DatabaseAPI.getNumFSem ( String  courseSubject,
int  courseNum,
String  professor,
String  term,
int  year 
) throws SQLException

gets the number of F's for a class for a certain semester and year

Parameters
courseSubject
courseNum
professor
term
year
Returns
totalNumF which is the number of F's for that semester
Exceptions
SQLException
int DatabaseAPI.getNumQDrop ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

counts total number of Q Drops given by a professor in a specific subject and course number. However, this one is just in case I need a random SQL query and can't re-setup the class

Parameters
courseSubject
courseNum
professor
Returns
totalQDrop
Exceptions
SQLException
int DatabaseAPI.getNumSemestersTaught ( String  subject,
int  courseNum,
String  professor 
) throws SQLException

Counts the number of semesters a professor has taught a class for a specific subject and specific course number

Parameters
subject
courseNum
professor
Returns
Exceptions
SQLException
ArrayList<Double> DatabaseAPI.getPastSemesterGPAs ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

returns an array of the average GPAs for the last 5 years. Is sized accordingly in case a professor has taught for less than 5 years

Parameters
courseSubject
courseNum
professor
Returns
Exceptions
SQLException
ArrayList<String> DatabaseAPI.getPastSemesters ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

gets the semester terms to match the output of the getPastSemesterGPAs function

Parameters
courseSubject
courseNum
professor
Returns
Exceptions
SQLException
double DatabaseAPI.getPercentA ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

Calculates the percentage of A's given by a teacher

Parameters
courseSubject
courseNum
professor
Returns
percentage of A's (double)
Exceptions
SQLException
double DatabaseAPI.getPercentB ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

Calculates the percentage of B's given by a teacher

Parameters
courseSubject
courseNum
professor
Returns
percentage of B's (double)
Exceptions
SQLException
double DatabaseAPI.getPercentC ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

Calculates the percentage of C's given by a teacher

Parameters
courseSubject
courseNum
professor
Returns
percentage of C's (double)
Exceptions
SQLException
double DatabaseAPI.getPercentD ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

Calculates the percentage of D's given by a teacher

Parameters
courseSubject
courseNum
professor
Returns
percentage of D's (double)
Exceptions
SQLException
double DatabaseAPI.getPercentF ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

Calculates the percentage of F's given by a teacher

Parameters
courseSubject
courseNum
professor
Returns
percentage of F's (double)
Exceptions
SQLException
double DatabaseAPI.getPercentQDrops ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

Calculates the percentage of Q Drops given by a teacher

Parameters
courseSubject
courseNum
professor
Returns
percentage of Q Drops (double)
Exceptions
SQLException
ArrayList<String> DatabaseAPI.getProfRawData ( String  subject,
int  courseNum,
String  professor 
) throws SQLException

Gets the raw data from the table and returns it in an arraylist in case I want to display the raw data for the user to view in a non-editable java table

Parameters
subject
courseNum
professor
Returns
Exceptions
SQLException
int DatabaseAPI.getTotalNumStudentsTaught ( String  courseSubject,
int  courseNum,
String  professor 
) throws SQLException

Counts the number of students a Professor has taught for a particular course. Is used independently of the class in case I it would be best not to re-setup the class.

Parameters
courseSubject
courseNum
professor
Returns
totalStudents which is the total number of students this professor has taught for this course
Exceptions
SQLException
void DatabaseAPI.insert ( String  Subject,
int  courseNum,
int  sectionNum,
Double  avgGPA,
String  professor,
int  numA,
int  numB,
int  numC,
int  numD,
int  numF,
int  numQdrop,
String  termSemester,
int  termYear,
boolean  honors 
)

Inserts all of the information given into the database table. This is now unnecessary since all of the insert functionality has been moved to the TamuGradeAnalyzer-Insert project

Parameters
Subject
courseNum
sectionNum
avgGPA
professor
numA
numB
numC
numD
numF
numQdrop
termSemester
termYear
honors
static void DatabaseAPI.main ( String[]  args)
static

Main function for testing the class


The documentation for this class was generated from the following file: