-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdelete.jsp
55 lines (53 loc) · 1.92 KB
/
vdelete.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
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#CC99FF">
<p><font size="6" color="#008000"> <img src="../images/tiharm.gif"></font></p>
<p><font size="6" color="#008000">Visitor Deletion Form</font>
<br>
</p>
<hr color="red">
<%
Connection con1=null;
Statement stmt1=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(Exception e){}
con1=DriverManager.getConnection("jdbc:odbc:jail","tihar","jail");
stmt1=con.createStatement();
int str1=Integer.parseInt(request.getParameter("text1"));
int j=stmt1.executeUpdate("delete from visitor where vid="+str1+"");
if(j==1)
out.println("visitor deleted successfully");
else
out.println("Sorry wrong customer name");
%>
<%
Connection con=null;
Statement stmt=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(Exception e){}
con=DriverManager.getConnection("jdbc:odbc:jail","tihar","jail");
stmt=con.createStatement();
int str=Integer.parseInt(request.getParameter("text1"));
int i=stmt.executeUpdate("delete from visit where vid="+str+"");
%>
<br><br><br><br><br><br>
<form>
<p align="center">
<font size="5" color="#008000">Enter Visitor Id </font>
<input type="text" name="text1" size="50" width="15">
<br><br><br><br>
<input align="middle" type="submit" value="Click For Delete" border="4">
</form>
</p>
<br>
</body>
</html>