1、 CREATE TABLE BBSAccount( AccountID bigint auto_increment primary key, NickName varchar(30) NOT NULL, Birthday datetime, Password varchar(20), State char(2), SEmail varchar(50)); CREATE TABLE BBSSector( SectorID int auto_increment primary key, AccountID bigint not null, SectorName va
2、rchar(20) not null, ClickingRate int default ‘0’, TopicCount bigint default ‘0’, FOREIGN KEY(AccountID )REFERENCES BBSAccount(AccountID) ON UPDATE CASCADE ON DELETE RESTRICT); CREATE TABLE BBSTopic( TopicID bigint auto_increment primary key, AccountID bigint not null, Title varchar(
3、50) not null, TopicText text not null, TopicDate timestamp null default current_timestamp, ReplyCount int not null, ClickingRate int default ‘0’, SectorID int not null, FOREIGN KEY(AccountID) REFERENCES BBSAccount(AccountID) ON UPDATE CASCADE ON DELETE RESTRICT, FOREIGN KEY(SectorID) REFERENC
4、ES BBSSector(SectorID) ON UPDATE CASCADE ON DELETE RESTRICT); CREATE TABLE BBSReply( ReplyID bigint auto_increment primary key, TopicID bigint not null, AccountID bigint not null, ReplyText varchar(2000) not null, ReplyDate timestamp null default current_timestamp, ClickingRate int d
5、efault ‘0’, Foreign key(TopicID) references BBSTopic (TopicID) ON UPDATE CASCADE ON DELETE RESTRICT, FOREIGN KEY(AccountID) REFERENCES BBSAccount(AccountID) ON UPDATE CASCADE ON DELETE RESTRICT); package model; public class BBSAccount implements java.io.Serializable { private Int
6、eger AccountID; private String NickName; private String Birthday;//timestamp对应的是什么类型? private String Password; private String State; private String SEmail; public BBSAccount(){} public BBSAccount(Integer AccountID, String NickName, String Bir
7、thday, String Password, String State ,String SEmail){ this. AccountID = AccountID; this.NickName= NickName; this. Birthday= Birthday; this. Password= Password; this. State= State; this. SEmail= SEmail;} public
8、String getAccountID (Integer AccountID){ return AccountID;} public void setAccountID(Integer AccountID){ this. AccountID = AccountID;} public String getNickName(String NickName){ return NickName;} public void setNick
9、Name(String NickName){ this.NickName= NickName;} public String getBirthday(String Birthday){ return Birthday;} public void setPassword(String Password){ this. Password= Password;} public String getState(String State
10、){ return State;} public void setState(String State){ this. State= State;} public String getSEmail(String SEmail){ return SEmail;} public void setSEmail(String SEmail){ this. SEmail= SEmail;} public String getPassword(String Password){ return Password;} public void setBirthday(String Birthday){ this. Birthday= Birthday;}
©2010-2025 宁波自信网络信息技术有限公司 版权所有
客服电话:4009-655-100 投诉/维权电话:18658249818