资源简介
博客系统网站(JSP+SERVLET+MYSQL),使用j2ee开发,适合学习

代码片段和文件信息
package com.admin;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.datalink.Datalink;
public class AdminDeleteArticleDAO extends HttpServlet {
/**
* The doGet method of the servlet.
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
doPost(requestresponse);
}
/**
* The doPost method of the servlet.
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
response.setContentType(“text/html;charset=gb2312“);
PrintWriter out = response.getWriter();
String strarticle_no = request.getParameter(“article_no“);
int article_no = Integer.parseInt(strarticle_no);
String speaker = request.getParameter(“currentusername“);
String DELETE_SQL = “delete from article where article_no = ?“;
try{
Datalink datalink = new Datalink();
Connection con = datalink.getConnection();
PreparedStatement ps = null;
con.setAutoCommit(false);
ps = con.prepareStatement(DELETE_SQL);
ps.setInt(1article_no);
ps.executeUpdate();
con.commit();
try{
ps.close();
con.close();
}catch(SQLException e2){
out.print(“数据库关闭失败!“);
out.print(“ript language=‘javascript‘>“);
out.print(“alert(‘操作出错‘);history.back();“);
out.print(“ ript>“);
}
deleteReply(article_no);
}catch(SQLException e){
System.out.print(e.getMessage());
out.print(“ript language=‘javascript‘>“);
out.print(“alert(‘操作出错‘);history.back();“);
out.print(“ ript>“);
out.flush();
}
speaker = new String(speaker.getBytes(“gb2312“)“ISO8859_1“);
response.sendRedirect(“adminforum.jsp?username=“+speaker+“&&numberpage=3“);
return;
}
public boolean deleteReply(int article_no){
String DELETESQLL = “delete from re_article where article_no = ?“;
try{
Datalink datalink = new Datalink();
Connection con = datalink.getConnection();
PreparedStatement ps = null;
con.setAutoCommit(false
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2477 2008-03-24 21:00 blog\aboutus.jsp
文件 7311 2007-12-04 20:29 blog\admin\adminforum.jsp
文件 6468 2007-12-04 20:29 blog\admin\adminforum_action.jsp
文件 1740 2007-12-04 20:29 blog\admin\adminindex.jsp
文件 1747 2007-12-04 20:29 blog\admin\adminphoto.jsp
文件 898 2008-03-24 21:00 blog\admin\footer.jsp
文件 3576 2007-12-04 20:22 blog\admin\header.jsp
文件 4087 2007-12-04 20:29 blog\admin\liuyan.jsp
文件 3180 2007-12-03 19:16 blog\admin\login.jsp
文件 755 2007-11-19 11:34 blog\admin\logout.jsp
文件 3076 2007-12-04 20:29 blog\admin\message.jsp
文件 3393 2007-12-05 21:44 blog\admin\modifymessage.jsp
文件 5844 2007-12-04 20:28 blog\admin\showmessage.jsp
文件 11233 2007-12-04 20:42 blog\admin\user.jsp
文件 5687 2007-12-04 20:28 blog\admin\usermodify.jsp
文件 2971 2007-12-04 20:30 blog\admin\viewmessage.jsp
文件 167 2007-11-11 15:32 blog\commons\403.jsp
文件 328 2007-11-17 16:37 blog\commons\404.jsp
文件 481 2007-11-17 16:43 blog\commons\500.jsp
文件 571 2007-11-25 13:14 blog\css\design.css
文件 722 2007-12-04 00:07 blog\css\footer.css
文件 834 2007-12-02 14:06 blog\css\footerpage.css
文件 1887 2007-12-02 00:31 blog\css\index.css
文件 2729 2007-12-04 14:07 blog\css\index_div.css
文件 1931 2006-08-06 19:42 blog\css\lightbox.css
文件 2519 2007-12-03 17:26 blog\css\mm_health_nutr.css
文件 4548 2007-11-25 20:19 blog\css\screen.css
文件 5971 2007-12-04 13:41 blog\css\toolbar.css
文件 5757 2007-05-01 08:44 blog\editbox\editbox.htm
文件 525 2007-05-01 08:54 blog\editbox\test.html
............此处省略347个文件信息
相关资源
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
- [免费]java实现有障碍物的贪吃蛇游戏
评论
共有 条评论