@Override public StudentModel getDOB(AuthenticationModel authenticationModel) { // TODO Auto-generated method stub StudentModel studentModel = new StudentModel(); studentModel.setStudentEmailID(authenticationModel.getUserName()); ResultSet myRes = null; try { Class.forName("com.mysql.jdbc.Driver"); Connection myCon = DriverManager.getConnection("jdbc:mysql://localhost:3306/EnrollTrackDB", "root", ""); Statement myStmt = myCon.createStatement(); myRes = myStmt.executeQuery( "SELECT `studentDOB` from studentInformation where studentEmail='" + studentModel.getStudentEmailID() + "'"); while (myRes.next()) { studentModel.setDOB(myRes.getString("studentDOB")); } } catch (Exception e) { e.printStackTrace(); } return studentModel; }
@Override public StudentModel getCurrentLoginStudent(StudentModel studentModel) { // TODO Auto-generated method stub ResultSet myRes = null; try { Class.forName("com.mysql.jdbc.Driver"); Connection myCon = DriverManager.getConnection("jdbc:mysql://localhost:3306/EnrollTrackDB", "root", ""); Statement myStmt = myCon.createStatement(); myRes = myStmt.executeQuery( "SELECT * FROM studentInformation , InterviewNeeded " + "where studentInformation.studentId = '" + studentModel.getStudentID() + "' and " + "studentInformation.InterviewNeeded_InterviewID = InterviewNeeded.InterviewID"); while (myRes.next()) { studentModel.setStudentID( Integer.parseInt(myRes.getString("studentInformation.studentId"))); studentModel.setFirstName(myRes.getString("studentInformation.studentFirstName")); studentModel.setLastName(myRes.getString("studentInformation.studentLastName")); studentModel.setCurrentGPA(myRes.getInt("studentInformation.currentGPA")); studentModel.setCellNumber(myRes.getString("studentInformation.studentCellNumber")); studentModel.setHomePhone(myRes.getString("studentInformation.studentHomePhone")); studentModel.setDOB(myRes.getString("studentInformation.studentDOB")); studentModel.setCurrentGrade( myRes.getInt("studentInformation.CurrentGrade_currentGradeId")); studentModel.setStudentEmailID(myRes.getString("studentInformation.studentEmail")); studentModel.interviewNeededModel.setInterviewID( myRes.getInt("studentInformation.InterviewNeeded_InterviewID")); studentModel.interviewNeededModel.setInterviewStatus( myRes.getString("InterviewNeeded.InterviewStatus")); } myRes = myStmt.executeQuery( "SELECT * FROM Gender,studentInformation,Ethnicity,School,CurrentGrade " + "where studentInformation.studentId = '" + studentModel.getStudentID() + "' AND " + "studentInformation.Ethnicity_ethnicityId = Ethnicity.ethnicityId AND " + "School.schoolId = studentInformation.School_schoolId AND " + "studentInformation.Gender_genderId = Gender.genderId AND " + "CurrentGrade.currentGradeId = studentInformation.CurrentGrade_currentGradeId"); while (myRes.next()) { studentModel.setStudentID( Integer.parseInt(myRes.getString("studentInformation.studentId"))); studentModel.setFirstName(myRes.getString("studentInformation.studentFirstName")); studentModel.setLastName(myRes.getString("studentInformation.studentLastName")); studentModel.setCurrentGPA(myRes.getInt("studentInformation.currentGPA")); studentModel.setCellNumber(myRes.getString("studentInformation.studentCellNumber")); studentModel.setHomePhone(myRes.getString("studentInformation.studentHomePhone")); studentModel.setDOB(myRes.getString("studentInformation.studentDOB")); studentModel.setCurrentGrade( myRes.getInt("studentInformation.CurrentGrade_currentGradeId")); studentModel.genderModel.setGenderName(myRes.getString("Gender.genderName")); studentModel.genderModel.setGenderID(myRes.getInt("Gender.genderId")); studentModel.ethnicityModel.setEthnicityName(myRes.getString("Ethnicity.ethnicityName")); studentModel.ethnicityModel.setEthnicityID(myRes.getInt("Ethnicity.ethnicityId")); studentModel.schoolModel.setSchoolName(myRes.getString("School.schoolName")); studentModel.schoolModel.setSchoolID(myRes.getInt("School.schoolId")); studentModel.gradeModel.setCurrentGrade(myRes.getString("CurrentGrade.currentGrade")); studentModel.gradeModel.setCurrentGradeId(myRes.getInt("CurrentGrade.currentGradeId")); studentModel.setStudentEmailID(myRes.getString("studentInformation.studentEmail")); } } catch (Exception e) { e.printStackTrace(); } return studentModel; }