-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndViewImage.jsp
83 lines (72 loc) · 3.46 KB
/
IndViewImage.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<%--
Document : IndViewImage
Created on : May 6, 2020, 5:09:18 PM
Author : Kavishka Wijesekera
--%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="db.DBCon"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="bootstrap.html" />
<script src="swl/dist/sweetalert-dev.js"></script>
<title>JSP Page</title>
</head>
<body style="background-color:#b2beb5">
<jsp:include page="navbar.jsp" />
<br><br>
<div class="col-md-12 col-sm-6 col-xs-12 text-center " >
<h2 style="font-family: Serif;font-weight: bold;color:saddlebrown;font-size:50px;">Industry Events and meetup</h2>
<br><br>
</div>
<table class="table table-dark table-hover">
<tbody>
<tr>
<td><center><b>Id</b></center><td><center><b>First Name</b></center></td><td><center><b>Last Name</b></center></td><td><center><b>Image</b></center></td>
</tr>
<%
try
{
DBCon dbconn=new DBCon();
Connection connectToDB= dbconn.connectToDB();
String sqlString = "SELECT * FROM induevnt";
Statement myStatement = connectToDB.createStatement();
ResultSet rs=myStatement.executeQuery(sqlString);
if(!rs.isBeforeFirst())
{
%>
<tr>
<td colspan="3"><center><%out.print("No Files!"); %></center></td>
</tr>
<%
}
while(rs.next())
{
%>
<tr>
<td><center><%out.print(rs.getString("id")); %></center></td>
<td><center><%out.print(rs.getString("firstname")); %></center></td>
<td><center><%out.print(rs.getString("lastname")); %></center></td>
<td><center><a href="Viewnew3.jsp?id=<%out.print(rs.getString("id"));%>">View Image</a></center></td>
</tr>
<%
}
%>
</tbody>
</table>
<%
rs.close();
myStatement.close();
connectToDB.close();
}catch(Exception e){e.printStackTrace();}
%>
</body>
</html>