123456789101112131415161718192021222324252627282930313233 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8" import="java.sql.*"%>
- <!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=UTF-8">
- <title>删除页面</title>
- </head>
- <body>
- <%
- request.setCharacterEncoding("utf-8");
- String id = request.getParameter("id");
- String url="jdbc:mysql://127.0.0.1:3306/teamessage?serverTimezone=UTC";
- String username = "root";
- String password = "1314";
- Connection connn = DriverManager.getConnection(url,username,password);
- String sql = "delete from article where id=?";
- PreparedStatement pstmtn = connn.prepareStatement(sql);
- pstmtn.setInt(1,Integer.parseInt(id));
- int result = pstmtn.executeUpdate();
- String msgn = "删除失败,单击点击跳转到论文信息页面";
- if(result==1){
- msgn = "删除成功,跳转到论文信息页面";
- }
- pstmtn.close();
- connn.close();
- %>
- <script>window.alert('<%= msgn %>');</script>
- <%
- response.setHeader("Refresh","2;url=articleMessage.jsp");
- %>
- </body>
- </html>
|