forked from kirannegi0149/Employee-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete-record.jsp
More file actions
63 lines (56 loc) · 1.72 KB
/
delete-record.jsp
File metadata and controls
63 lines (56 loc) · 1.72 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
<%@ include file="navbar.jsp" %>
<html>
<head>
<style>
/* General body styling */
body {
margin: 0;
font-family: 'Arial', sans-serif;
background-color: #f8f9fa;
color: #333;
}
/* Centering the div */
.dv {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f8f5;
}
/* Styling for the success message */
.message {
color: #28a745;
font-size: 1.8rem;
font-weight: bold;
text-align: center;
padding: 20px 40px;
border: 2px solid #28a745;
border-radius: 15px;
background-color: #eaffea;
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* Hover effect for the message box */
.message:hover {
transform: scale(1.05);
box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body onload="makeActive('delete')">
<%
//Loading Driver Class
Class.forName("com.mysql.cj.jdbc.Driver");
//Creating connection object
Connection cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/jsp10", "root", "mysqlkiran011");
//Creating PreparedStatement object
PreparedStatement ps = cn.prepareStatement("delete from employeeinfo where eid=?");
ps.setString(1, request.getParameter("eid"));
//Execute Update query
ps.executeUpdate();
%>
<div class="dv">
<label class="message">Employee record has been deleted successfully</label>
</div>
</body>
</html>