예제 #1
0
 public String getClassNo() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   List<Map<String, Object>> result =
       SqlUtils.executeSqlQuery("SELECT classNo " + "FROM class WHERE id = ?", map);
   classNo = (String) result.get(0).get("classNo");
   return classNo;
 }
예제 #2
0
 public Integer getStudentCount() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   List<Map<String, Object>> result =
       SqlUtils.executeSqlQuery(
           "SELECT COUNT(*) AS studentCount " + "FROM student WHERE classId = ?", map);
   studentCount = (int) (long) (Long) result.get(0).get("studentCount");
   return studentCount;
 }
예제 #3
0
 public List<Map<String, Object>> getStudentList() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   studentList =
       SqlUtils.executeSqlQuery(
           "SELECT id, studentNo, studentName, macAddress\n"
               + "FROM student\n"
               + "WHERE classId = ?\n"
               + "ORDER BY studentNo",
           map);
   return studentList;
 }
예제 #4
0
 public List<Map<String, Object>> getCourseList() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   courseList =
       SqlUtils.executeSqlQuery(
           "SELECT course.id AS courseId, course.courseName AS courseName \n"
               + "FROM course, courseClass\n"
               + "WHERE course.id = courseClass.courseId AND courseClass.classId = ?\n"
               + "ORDER BY course.id",
           map);
   return courseList;
 }