企业信息交流系统.,只要用语多家企业或者一家企业有多家分公司间的信息交流

源代码在线查看: delete.java

软件大小: 1449 K
上传用户: xiaoluya54
关键词: 交流 企业信息
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				 * delete.java //删除信息
				 *
				 * Created on 2007年5月27日, 下午7:01
				 */
				
				package inc;
				
				import java.io.*;
				import java.net.*;
				import java.sql.*;
				import javax.sql.*;
				import inc.condb;
				import javax.servlet.*;
				import javax.servlet.http.*;
				
				public class delete
				    extends HttpServlet {
				
				  public void doGet(HttpServletRequest request, HttpServletResponse response) throws
				      ServletException, IOException {
				    response.setContentType("text/html;charset=UTF-8");
				    PrintWriter out = response.getWriter();
				    HttpSession session = request.getSession();
				    String username = (String) session.getAttribute("username");
				    String id = request.getParameter("id");
				    int Id = Integer.parseInt(id);
				    if (username == null) {
				      response.sendRedirect("index.html");
				      return;
				    }
				    try {
				
				      String delesql = "delete from messageinfo where messageid=" + Id + "";
				      condb conn = new condb();
				      conn.executeUpdate(delesql);
				      out.println("\r\n");
				      out.println("{ \r\n");
				      out.println("alert(\"恭喜你,删除成功\"); \r\n");
				      out.println("window.document.location.href=\"#\";\r\n");
				      out.println("}\r\n");
				      out.println("");
				    }
				    catch (Exception e) {
				
				    }
				
				  }
				
				  public void doPost(HttpServletRequest request, HttpServletResponse response) throws
				      ServletException, IOException {
				    doGet(request, response);
				  }
				}
							

相关资源