forked from kirannegi0149/Employee-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.jsp
More file actions
119 lines (110 loc) · 3.39 KB
/
list.jsp
File metadata and controls
119 lines (110 loc) · 3.39 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<%@ include file="navbar.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Employee List</title>
<style>
body {
font-family: Arial, sans-serif;
background-color:#dde3df;
margin: 0;
padding: 0;
}
.table-container {
max-width: 80%;
margin: 50px auto;
background: #ffffff;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
overflow: hidden;
}
table {
width: 100%;
border-collapse: collapse;
text-align: left;
background-color: #ffffff;
}
thead tr {
background-color: #4CAF50;
color: white;
text-transform: uppercase;
}
th, td {
padding: 12px 15px;
border: 1px solid #ddd;
}
tbody tr:nth-child(even) {
background-color: #f9f9f9;
}
tbody tr:hover {
background-color: #f1f1f1;
cursor: pointer;
}
@media screen and (max-width: 768px) {
table {
display: block;
overflow-x: auto;
}
thead tr {
display: block;
}
tbody tr {
display: table-row;
}
}
/* Styling the page title */
.title {
font-weight:bold;
text-align: center;
margin: 20px;
font-size: 30px;
color: #333333;
}
</style>
</head>
<body onload="makeActive('list')">
<div class="title">Employee Information</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Employee ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
<th>Department</th>
<th>Email id</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<%
// Load MY SQL Driver
Class.forName("com.mysql.cj.jdbc.Driver");
//Established database connection
Connection cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/jsp10", "root", "mysqlkiran011");
//Statement Query
Statement st = cn.createStatement();
//Execute the resultset query
ResultSet rst = st.executeQuery("select * from employeeinfo");
while (rst.next())
{
%>
<tr>
<td><%=rst.getString(1) %></td>
<td><%=rst.getString(2) %></td>
<td><%=rst.getString(3) %></td>
<td><%=rst.getString(4) %></td>
<td><%=rst.getString(5) %></td>
<td><%=rst.getString(6) %></td>
<td><%=rst.getString(7) %></td>
</tr>
<%
}
%>
</tbody>
</table>
</div>
</body>
</html>