📄 del6.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" 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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e)
{
out.print(e);
}
try{
String strDirPath=application.getRealPath(request.getRequestURI());
strDirPath=strDirPath.substring(0,strDirPath.lastIndexOf('\\'))+"\\";
strDirPath=application.getRealPath("ODBC/gongyu.mdb");
String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+strDirPath;
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
request.setCharacterEncoding("gb2312");
if(request.getParameter("del")!=null)stmt.executeUpdate("delete * FROM main where id="+request.getParameter("del"));
stmt.close();
conn.close();
}
catch(Exception ex)
{
out.print(ex);
}
%>
<%
session.removeAttribute("login");
session.removeAttribute("userpwd");
response.sendRedirect("gongyu.jsp");
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -