📄 handledelete.jsp
字号:
<%-- Document : handledelete Created on : 2008-3-16, 18:26:53 Author : Administrator--%><%@page contentType="text/html" pageEncoding="GB2312"%><%@page import="java.sql.*"%><%@page import="java.io.*;"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><% try{ Class.forName("com.mysql.jdbc.Driver").newInstance(); } catch(Exception e){ } Connection con; Statement sql; ResultSet rs; try{ String url="jdbc:mysql://localhost/taotao"; String user="taotao"; String password=".nothing"; con=DriverManager.getConnection(url,user,password); String strId=request.getParameter("todel"); //byte b[]=str.getBytes("GB2312"); //str=new String(b); int nn=Integer.parseInt(strId); //byte b[]=strContent.getBytes("GB2312"); //strContent=new String(b); String deleteCondition="delete from messages where number="+nn; sql=con.createStatement(); sql.executeUpdate(deleteCondition); } catch(SQLException e){ } //response.encodeRedirectURL("handledisplay.jsp"); RequestDispatcher dispatcher=request.getRequestDispatcher("handledisplay.jsp"); dispatcher.forward(request, response);%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -