用户管理系统
最后更新于:2022-04-01 09:42:27
# 用户管理系统
### 基本概述
该系统是一个简单的用户管理系统,目前实现的功能不是很多,但是可以扩展。其结构采用的是MVC模式。
### MVC模型示意图
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-02-23_56cbf600ab430.jpg)
### 系统框架图
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-02-23_56cbf600ccb78.jpg)
### 开发目录结构图
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-02-23_56cbf600f1180.jpg)
### 注意事项:
数据库采用的是Oracle数据库,用户名,密码之类的在上图的dbinfo.properties文件下更改,使用其他数据库也是在该文件下更改驱动名称。
### SQL
~~~
create table users
(
id number primary key, --id
username varchar2(32) not null, --用户名
email varchar2(64) not null, --电子邮箱
grade number default 1, --等级 1->5 1为普通用户,5为管理员
passwd varchar2(32) not null --密码
);
--插入测试数据
insert into users values(1,'zhangsan','zhangsan@switch.com',1,'123456');
insert into users values(2,'lisi','lisi@switch.com',1,'123456');
insert into users values(3,'wangwu','wangwu@switch.com',1,'123456');
insert into users values(4,'zhaoliu','zhaoliu@switch.com',1,'123456');
insert into users values(5,'switch','switch@switch.com',5,'switch');
insert into users values(6,'AAA','AAA@switch.com',1,'123456');
insert into users values(7,'BBB','BBB@switch.com',1,'123456');
insert into users values(8,'CCC','CCC@switch.com',1,'123456');
insert into users values(9,'DDD','DDD@switch.com',1,'123456');
insert into users values(10,'EEE','EEE@switch.com',1,'123456');
insert into users values(11,'FFF','FFF@switch.com',1,'123456');
insert into users values(12,'GGG','GGG@switch.com',1,'123456');
insert into users values(13,'HHH','HHH@switch.com',1,'123456');
insert into users values(14,'AAA','AAA@switch.com',1,'123456');
insert into users values(15,'BBB','BBB@switch.com',1,'123456');
insert into users values(16,'CCC','CCC@switch.com',1,'123456');
insert into users values(17,'DDD','DDD@switch.com',1,'123456');
insert into users values(18,'EEE','EEE@switch.com',1,'123456');
insert into users values(19,'FFF','FFF@switch.com',1,'123456');
insert into users values(20,'GGG','GGG@switch.com',1,'123456');
insert into users values(21,'HHH','HHH@switch.com',1,'123456');
insert into users values(22,'HHH','HHH@switch.com',1,'123456');
--分页语句
select * from (select u.*,rownum rn from (select * from users order by id) u where rownum <= 6) where rn >=4;
--序列自增长
create sequence users_seq
start with 100
increment by 1
minvalue 100
nomaxvalue
nocycle
nocache;
~~~
源代码:[http://download.csdn.net/detail/q547550831/9391557](http://download.csdn.net/detail/q547550831/9391557)
导入MyEclipse就能用了。
----------参考《韩顺平.细说Servlet》