⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delete.jsp

📁 在jsp环境下用java编写的 请使用 多多指教
💻 JSP
字号:
<%@ page contentType="text/html;charset=GB2312" %><%@ page import="java.sql.*" %><%@ page import="yy.Login" %><jsp:useBean id="login" class="Login" scope="session" ></jsp:useBean><% //如果客户直接进入该页面将被转向登录页面。   if(session.isNew())    {response.sendRedirect("login.jsp");     }   //如果没有成功登录将被转向登录页面   String success=login.getSuccess();         if(success==null)         {success="";         }    if(!(success.equals("ok")))     {response.sendRedirect("login.jsp");      }%><HTML><BODY ><Font size=3><table align="center" border="0" width="790" height="12" bgcolor=cyan cellspacing="0">  <tr><td width="100%"><a href="<%=response.encodeURL("showMember.jsp")%>">浏览会员</a> | <a href="<%=response.encodeURL("register.jsp")%>">会员注册</a> | <a href="<%=response.encodeURL("login.jsp")%>">会员登录   </a> |<a href="<%=response.encodeURL("find.jsp")%>">查找会员     </a> | <a href="<%=response.encodeURL("Message.jsp")%>">留言板</a>|<a href="<%=response.encodeURL("publicMessage.jsp")%>">查看公共留言</a>|<a href="<%=response.encodeURL("secretMessage.jsp")%>">查看私人留言</a>|<a href="<%=response.encodeURL("modifyPassword.jsp")%>">修改密码 </a> |<a href="<%=response.encodeURL("modifyMessage.jsp")%>">修改个人信息 </a>| </td>  </tr> </table></table> <% //获取提交的信息的时间:    String time=request.getParameter("time");          if(time==null)            {time="";            }     byte b[]=time.getBytes("ISO-8859-1");     time=new String(b);    Connection con=null;    Statement sql=null;    ResultSet rs=null;       try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");          }       catch(ClassNotFoundException event){}       try        {con=DriverManager.getConnection("jdbc:odbc:friend","sa","");         sql=con.createStatement();         //删除操作:          String s=login.getLogname();          String condition1=              "DELETE  FROM secretwordpad WHERE logname ="+"'"+s+"'";          String condition2=               "AND time ="+"'"+time+"'";          String condition=condition1+condition2;          sql.executeUpdate(condition);          out.print("删除了该留言");          con.close();        }       catch(SQLException event)        {out.print(""+event);        }%></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -