資源簡(jiǎn)介
介紹一個(gè)網(wǎng)上論壇系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn),包塊系統(tǒng)得整體設(shè)計(jì)、數(shù)據(jù)庫(kù)設(shè)計(jì)和頁(yè)面代碼實(shí)現(xiàn)....

代碼片段和文件信息
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;
???
????//構(gòu)造函數(shù),對(duì)成員變量進(jìn)行初始化賦值
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數(shù)據(jù)表中添加一條新記錄
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對(duì)應(yīng)的文章的信息
public?boolean?delete()
{
this.strSql=“delete?from?‘a(chǎn)rticles‘?where?ArticleID=‘“;
this.strSql=this.strSql?+?this.ArticleID?+?“‘“;
boolean?isDelete?=?super.exeSql(this.strSql);
????????
return?isDelete;
}
//驗(yàn)證ArticleID和UserID是否匹配??
public?boolean?valid()
{
this.strSql=“select?ArticleID?from?‘a(chǎn)rticles‘?“;
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對(duì)應(yīng)的文章的信息,將這些信息賦值給相應(yīng)的類變量
public?boolean??init()
{
???? this.strSql=“select?*?from?‘a(chǎn)rticles‘?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
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????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個(gè)文件信息
- 上一篇:安卓SL4A_R6.APK文件
- 下一篇:JavaFX拖放操作
評(píng)論
共有 條評(píng)論