SSH1环境搭建

以上视频供参考,本人操作如下:

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值