for (int i = 0; i < cnt; i++) {
String lecturetime_sql = "select lecture_starttime, lecture_finishtime from lecture where lecture_id = "
+ array2[i][0];
rs = st.executeQuery(lecturetime_sql);
while (rs.next()) {
array2[i][1] = rs.getString(1);
array2[i][2] = rs.getString(2);
}
rs.close();
System.out.println("Lecture_id = "
+ array2[i][0] + ", StartTime = "
+ array2[i][1] + "("
+ transeMin(array2[i][1]) + ")"
+ ", FinishTime = " + array2[i][2]
+ "(" + transeMin(array2[i][2])
+ ")");
System.out.println(transeMin(nfctime));
String att_chk_time = null;
String att_chk_sql = "select start_time from attendance "
+ "where user_id = '"
+ user_id
+ "' and lecture_id = "
+ array2[i][0]
+ " and att_date = to_date('"
+ nfcday + "', 'mm/dd/yyyy')";
rs = st.executeQuery(att_chk_sql);
while (rs.next()) {
att_chk_time = rs.getString(1);
}
rs.close();
if (att_chk_time == null) {
if ((transeMin(array2[i][1]) - transeMin(nfctime)) < 10) {
if ((transeMin(nfctime) - transeMin(array2[i][2])) > 10) {
System.out.println("수업종료");
continue;
}
if ((transeMin(array2[i][1]) - transeMin(nfctime)) < 0) {
System.out.println("지각2");
} else {
System.out
.println("0~10분 정상출석입니다.1");
}
} else {
System.out.println("수업이 아닙니다.");
continue;
}
} else {
if ((transeMin(nfctime) - transeMin(att_chk_time)) < 10) {
System.out.println("너무 빨리 찍음");
continue;
} else {
if (transeMin(array2[i][2])
- transeMin(nfctime) > 0) {
System.out.println("조퇴3");
} else if (transeMin(nfctime)
- transeMin(array2[i][2]) < 10) {
System.out.println("정상퇴근");
} else {
System.out.println("수업이 아닙니다.");
continue;
}
}
}
}
'Computer > JAVA' 카테고리의 다른 글
Java HashMap (0) | 2014.08.13 |
---|---|
Java 16진수로 변환 (0) | 2014.08.12 |
JDBC SQL Select 기본 예제 (0) | 2014.08.11 |
java 배열 선언 (0) | 2014.08.08 |
JDBC 데이터베이스 연결 (0) | 2014.08.08 |