s.jsp
来自「为html格式的静态网页形式」· JSP 代码 · 共 31 行
JSP
31 行
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<jsp:useBean id="ConBean" scope="session"
class="com.bitc.ch13.DBCon"/>
<%
String id = request.getParameter("id");
Connection con = ConBean.getConnection();
Statement stmt = con.createStatement();
try{
String strdel = "delete vidc where id = '"+id+"'";
stmt.executeUpdate(strdel);
}catch(Exception e){
out.println(e.toString());
}
stmt.close();
ConBean.close();
%>
<script language="vbscript">
msgbox "成功删除!",vbInformation,"提示"
window.location="new.jsp"
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?