-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChalla_MeghnathReddy_IP_Task7c.jsp
50 lines (46 loc) · 1.34 KB
/
Challa_MeghnathReddy_IP_Task7c.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 language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Query Result</title>
</head>
<body>
<%@page import="client_db.DataHandler"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Array"%>
<%
// The handler is the one in charge of establishing the connection.
DataHandler handler = new DataHandler();
// Get the attribute values passed from the input form.
String Date_T = request.getParameter("Date_T");
/*
* If the user hasn't filled out all the time, movie name and duration. This is very
simple checking.
*/
if ( Date_T.equals("")) {
response.sendRedirect("add_movie_form1.jsp");
} else {
int Date_T1 = Integer.parseInt(Date_T);
// Now perform the query with the data from the form.
boolean success = handler.addMovie1(Date_T1);
if (!success) { // Something went wrong
%>
<h2>There was a problem inserting the course</h2>
<%
} else { // Confirm success to the user
%>
<h2>Team Table:</h2>
<ul>
<li>Date_T: <%=Date_T%></li>
</ul>
<h2>Was successfully inserted.</h2>
<a href="get_all_movies.jsp">See Teams Table.</a>
<%
}
}
%>
</body>
</html>