以上視頻供參考,本人操作如下:
Structs + Spring + Hibernate
( MyEclipse + MySql + Tomcat + ConnectionPool )
項目主要功能:
前台:
1、使用者登入、註冊、修改個人資訊
2、查詢個人提過的問題
3、檢索問題
後台:
1、管理欄目:一級欄目,二級欄目
2、系統管理使用者
3、維護管理員資訊
4、使用者等級維護
5、問題維護
一、建立資料庫
net start mysql;
配置環境變數path:D:\Program Files\MySQL\MySQL Server 5.5\bin
mysql -uroot -p******;
create database mldn;
commit;
use mldn
/*==============================================================*//* DBMS name: MySQL 5.0 *//* Created on: 2013-3-30 16:29:22 *//*==============================================================*/drop table if exists admin;drop table if exists answer;drop table if exists item;drop table if exists question;drop table if exists subitem;drop table if exists user;/*==============================================================*//* Table: admin *//*==============================================================*/create table admin( id int not null, adminid varchar(50), adminpwd varchar(50), primary key (id));/*==============================================================*//* Table: answer *//*==============================================================*/create table answer( aid int not null, quesans longtext, userid varchar(50), grade varchar(50), anstime datetime, status int, qid int, primary key (aid));/*==============================================================*//* Table: item *//*==============================================================*/create table item( itemid int not null, itemname varchar(50), itemcode int, primary key (itemid));/*==============================================================*//* Table: question *//*==============================================================*/create table question( qid int not null, title varchar(50), content longtext, itemid int, subid int, userid varchar(50), grade varchar(50), offerscore int, status int, questiontime datetime, clickcount int, acceptlag int, commenflag int, primary key (qid));/*==============================================================*//* Table: subitem *//*==============================================================*/create table subitem( subid int not null, subname varchar(50), itemid int, subcode int, primary key (subid));/*==============================================================*//* Table: user *//*==============================================================*/create table user( id int not null, userid varchar(50), userpwd varchar(50), userques varchar(50), userans varchar(50), usermail varchar(50), integral int, grade int, sex varchar(2), realname varchar(50), primary key (id));alter table answer add constraint FK_Reference_3 foreign key (qid) references question (qid) on delete restrict on update restrict;alter table question add constraint FK_Reference_4 foreign key (itemid) references item (itemid) on delete restrict on update restrict;alter table question add constraint FK_Reference_5 foreign key (subid) references subitem (subid) on delete restrict on update restrict;alter table subitem add constraint FK_Reference_1 foreign key (itemid) references item (itemid) on delete restrict on update restrict;
show tables ;
二、MyEclipse設定資料庫串連
資料庫建立好後:
三、創項目建SSH並添加SSH支援
添加順序:Spring -> Hibernate -> Struts