• 大小: 474KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-24
  • 语言: Java
  • 标签: jsp  tomcat  

资源简介

介绍一个网上论坛系统的设计与实现,包块系统得整体设计、数据库设计和页面代码实现....

资源截图

代码片段和文件信息

package com.chapter12;

import java.sql.*;

public class Article extends ExecuteDB
{
//定义类成员变量
private long ArticleID;
private String title;
private String Content; 
private long UserID;  
private long BoardID;   
private long FatherID; 
private int ReadCount; 
private int ReCount;    
private String PicUrl;
private String PicName;
private String CreateTime;   
private String strSql;
   
    //构造函数,对成员变量进行初始化赋值
public Article()
{       
this.ArticleID=0;
this.title=““;
this.Content=““;        
this.BoardID=0;
this.ReCount=0;
this.ReadCount=0;       
this.PicUrl=““;
this.PicName=““;
this.FatherID=0;
this.UserID=0;                      
java.util.Date NowTime = new java.util.Date();
this.CreateTime = NowTime.toLocaleString();                    
this.strSql=““;
}
   
//添加新文章,往articles数据表中添加一条新记录
public boolean add()
{
this.strSql=“insert into articles “;
this.strSql=this.strSql + “(“;
this.strSql=this.strSql + “titleContentUserIDBoardIDFatherIDReadCountReCountPicUrlPicNameCreateTime)“;
this.strSql=this.strSql + “values(‘“ + this.title + “‘‘“ + this.Content + “‘‘“ + this.UserID + “‘‘“ + this.BoardID + “‘‘“ + this.FatherID + “‘‘“ + this.ReadCount + “‘‘“ + this.ReCount + “‘‘“ + this.PicUrl + “‘‘“ + this.PicName + “‘‘“ + this.CreateTime + “‘)“;
boolean isAdd = super.exeSql(this.strSql);

return isAdd;
}
  
   //删除ArticleID对应的文章的信息
public boolean delete()
{
this.strSql=“delete from ‘articles‘ where ArticleID=‘“;
this.strSql=this.strSql + this.ArticleID + “‘“;
boolean isDelete = super.exeSql(this.strSql);
        
return isDelete;
}

//验证ArticleID和UserID是否匹配  
public boolean valid()
{
this.strSql=“select ArticleID from ‘articles‘ “;
this.strSql=this.strSql + “ where ArticleID=‘“ + this.ArticleID + “‘“;
this.strSql=this.strSql + “  and UserID=‘“+ this.UserID + “‘“;         
System.out.println(this.strSql);            

try
{
ResultSet rs = super.exeQuery(this.strSql); 
if (rs.next())
{
return true;
}
else
{                
return false;
}
}
catch(Exception ex)
{            
return false;
}       
}


   
   //获取ArticleID对应的文章的信息,将这些信息赋值给相应的类变量
public boolean  init()
{
     this.strSql=“select * from ‘articles‘ where ArticleID=“;
        this.strSql=this.strSql + “‘“ + this.ArticleID + “‘“;        
        try
{
    ResultSet rs = super.exeQuery(this.strSql);
if (rs.next())
{
                ArticleID=rs.getLong(“ArticleID“);
                title=rs.getString(“title“);
                Content=rs.getString(“Content“);
                BoardID=rs.getLong(“BoardID“);
                FatherID=rs.getLong(“FatherID“);
                ReadCount=rs.getInt(“ReadCount“);
                UserID=rs.getLong(“UserID“); 
                ReCount=rs.getInt(“ReCount“);
                PicUrl=rs.getString(“Pic

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3159  2007-01-28 21:59  CH12\chapter12\add_article_form.jsp

     文件       3126  2007-01-28 21:59  CH12\chapter12\add_article_save.jsp

     文件       4572  2007-01-28 21:59  CH12\chapter12\article_detail.jsp

     文件       4484  2007-01-28 21:59  CH12\chapter12\article_list.jsp

     文件       1328  2007-01-28 21:59  CH12\chapter12\board_list.jsp

     文件       1678  2007-01-28 21:59  CH12\chapter12\delete_article.jsp

     文件       1250  2007-01-28 21:59  CH12\chapter12\delete_email.jsp

     文件       1949  2007-01-28 21:59  CH12\chapter12\email_detail.jsp

     文件       2427  2007-01-28 21:59  CH12\chapter12\email_management.jsp

     文件       1601  2007-01-28 21:59  CH12\chapter12\image.jsp

     文件       1135  2007-01-28 21:59  CH12\chapter12\index.html

     文件       2857  2007-01-28 21:59  CH12\chapter12\info_management.jsp

     文件        446  2007-01-28 21:59  CH12\chapter12\lib\bbs.css

     文件        143  2007-01-28 21:59  CH12\chapter12\logout.jsp

     文件        806  2007-01-28 21:59  CH12\chapter12\main.jsp

     文件        704  2007-01-28 21:59  CH12\chapter12\manager\add_board_form.jsp

     文件       1311  2007-01-28 21:59  CH12\chapter12\manager\add_board_save.jsp

     文件       2053  2007-01-28 21:59  CH12\chapter12\manager\board_management.jsp

     文件       1272  2007-01-28 21:59  CH12\chapter12\manager\delete_board.jsp

     文件        812  2007-01-28 21:59  CH12\chapter12\manager\main.jsp

     文件       1029  2007-01-28 21:59  CH12\chapter12\manager\modify_board_form.jsp

     文件       1491  2007-01-28 21:59  CH12\chapter12\manager\modify_board_save.jsp

     文件       1313  2007-01-28 21:59  CH12\chapter12\manager\top.jsp

     文件       1464  2007-01-28 21:59  CH12\chapter12\modify_info_save.jsp

     文件       1661  2007-01-28 21:59  CH12\chapter12\modify_password_save.jsp

     文件       2886  2007-01-28 21:59  CH12\chapter12\send_email_form.jsp

     文件       1428  2007-01-28 21:59  CH12\chapter12\send_email_save.jsp

     文件       1295  2007-01-28 21:59  CH12\chapter12\top.jsp

     文件       1361  2007-01-28 21:59  CH12\chapter12\user_login.jsp

     文件       1630  2007-01-28 21:59  CH12\chapter12\user_reg_form.html

............此处省略33个文件信息

评论

共有 条评论