-
Notifications
You must be signed in to change notification settings - Fork 1
/
createCourse_verify.jsp
50 lines (47 loc) · 1.47 KB
/
createCourse_verify.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.sql.*" %>
<%@ include file="top.jsp" %>
<%@ include file="dbconfig.jsp" %>
<%
String c_id = request.getParameter("courseId");
String c_name = request.getParameter("courseName");
int c_id_no = Integer.parseInt(request.getParameter("courseIdNo"));
int c_unit = Integer.parseInt(request.getParameter("courseUnit"));
int t_time = Integer.parseInt(request.getParameter("courseTime"));
int t_max = Integer.parseInt(request.getParameter("courseMax"));
int t_day = Integer.parseInt(request.getParameter("courseDate"));
String t_where = request.getParameter("courseWhere");
String result = null;
CallableStatement stmt = null;
try {
stmt = myConn.prepareCall("call InsertTeach(?,?,?,?,?,?,?,?,?,?)");
stmt.setInt(1, session_id);
stmt.setString(2, c_id);
stmt.setInt(3, c_id_no);
stmt.setString(4, c_name);
stmt.setInt(5, c_unit);
stmt.setInt(6, t_max);
stmt.setInt(7, t_day);
stmt.setInt(8, t_time);
stmt.setString(9, t_where);
stmt.registerOutParameter(10, oracle.jdbc.OracleTypes.VARCHAR);
stmt.execute();
result = stmt.getString(10);
%>
<script>
alert("<%= result %>");
history.back();
</script>
<%
} catch (SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
} finally {
if (stmt != null)
try {
myConn.commit();
stmt.close();
myConn.close();
} catch (SQLException ex) {
}
}
%>