zoukankan      html  css  js  c++  java
  • 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

     

  • 相关阅读:
    python接口自动化(三)--如何设计接口测试用例(详解)
    python接口自动化(二)--什么是接口测试、为什么要做接口测试(详解)
    python接口自动化(一)--什么是接口、接口优势、类型(详解)
    PostgreSQL建立分区表示例
    PostgreSQL中的时间操作总结
    linux系统命令:yum和apt-get
    oracle中的连接查询与合并查询总结
    oracle中时间运算
    oracle中一些用法总结
    oracle中substr与instr
  • 原文地址:https://www.cnblogs.com/mingforyou/p/2990278.html
Copyright © 2011-2022 走看看