-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewusers.jsp
69 lines (50 loc) · 1.15 KB
/
viewusers.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
<%@ include file="aheader.jsp"%>
<%@ page import="java.sql.*" import="databaseconnection.*" %>
<%@ page import="java.sql.*" import="com.mysql.*" import="javax.swing.JOptionPane"%>
<h2>View Users</h2>
<head>
<style>
#tab {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#tab td, #tab th {
border: 1px solid #ddd;
padding: 8px;
}
#tab tr:nth-child(even){background-color: #f2f2f2;}
#tab tr:hover {background-color: #ddd;}
#tab th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
</style>
</head>
<%
try{
Connection con = DatabaseCon.getConnection();
Statement st=con.createStatement();
String sql="select * from users";
System.out.println(sql);
ResultSet rs=st.executeQuery(sql);
int sno=0;
%>
<table align="center" id="tab">
<tr><th>Sno<th>Name<th>Email<th>Contact<th>City
<%
while(rs.next()){
%>
<tr><td><%=++sno%><td><%=rs.getString("name")%><td><%=rs.getString("email")%><td><%=rs.getString("ph")%>
<td><%=rs.getString("city")%>
<%
}
}
catch(Exception e){
}
%>
</table>
<%@ include file="afooter.jsp"%>