分布式架构的图书管理系统

分布式是,图片,数据,代码,三块分离,因为数据库是独立的所以分布已经存在(如果要多电脑分布,那就把数据库放到其他)
电脑上访问,然后是图片分离,


图片我是存放到d盘的,跟服务器是独立的,但是服务器也能访问,这个就是分布式

 


几个配置要点说一下,如果你要改动路径,需要在这个common下改路径,如果用我的默认给好的,那就新建文件夹tupiancunfang
然后再文件夹下创建upload文件夹,后面的日期文件夹会自动创建的,默认的是D:\tupiancunfang\upload
如果你要改,那就是D:\xxxxxxxxx\upload,这种类似的改
还有tomcat服务器上的server.xml也需要改对应的路径,我给出了,到时候吧server.xml也发过去给你
这样就配置好了分布式
超级管理员账号 密码 admin 123456
能有的功能都有增删改查,模糊查询,分页
每个人能查看图书,然后借阅,管理员添加记录,这里有权限控制的,每个人只能看到自己的信息
修改,信息,修改密码都有

分布式架构的图书管理系统登录注册界面

分布式架构的图书管理系统mysql数据库版本源码:

超级管理员表创建语句如下:


create table t_admin(
	id int primary key auto_increment comment '主键',
	username varchar(100) comment '超级管理员账号',
	password varchar(100) comment '超级管理员密码'
) comment '超级管理员';
insert into t_admin(username,password) values('admin','123456');

读者表创建语句如下:


create table t_customer(
	id int primary key auto_increment comment '主键',
	username varchar(100) comment '账号',
	password varchar(100) comment '密码',
	customerName varchar(100) comment '姓名',
	age varchar(100) comment '年龄',
	sex varchar(100) comment '性别',
	phone varchar(100) comment '电话'
) comment '读者';

图书借阅表创建语句如下:


create table t_jy(
	id int primary key auto_increment comment '主键',
	customerId int comment '读者',
	tsId varchar(100) comment '图书编号',
	v1 varchar(100) comment '图书名称',
	v2 varchar(100) comment '借书日期',
	v3 varchar(100) comment '应还书日期',
	v4 varchar(100) comment '实际还书日期',
	v5 varchar(100) comment '逾期罚款额',
	v6 varchar(100) comment '借阅编号'
) comment '图书借阅';

书架表创建语句如下:


create table t_sj(
	id int primary key auto_increment comment '主键',
	sjName varchar(100) comment '书架编号',
	v1 varchar(100) comment '图书名称',
	v2 varchar(100) comment '图书编号',
	v3 varchar(100) comment '书库编号'
) comment '书架';

图书表创建语句如下:


create table t_ts(
	id int primary key auto_increment comment '主键',
	tsName varchar(100) comment '图书编号',
	v1 varchar(100) comment '书库编号',
	sjId int comment '书架编号',
	v3 varchar(100) comment '图书名称',
	v4 varchar(100) comment '图书价格',
	v5 varchar(100) comment '出版社',
	v6 varchar(100) comment '出版日期',
	v7 varchar(100) comment '作者',
	v8 varchar(100) comment '状态',
	numb int comment '数量',
	pic varchar(100) comment ''
) comment '图书';

分布式架构的图书管理系统oracle数据库版本源码:

超级管理员表创建语句如下:


create table t_admin(
	id integer,
	username varchar(100),
	password varchar(100)
);
insert into t_admin(id,username,password) values(1,'admin','123456');
--超级管理员字段加注释
comment on column t_admin.id is '主键';
comment on column t_admin.username is '超级管理员账号';
comment on column t_admin.password is '超级管理员密码';
--超级管理员表加注释
comment on table t_admin is '超级管理员';

读者表创建语句如下:


create table t_customer(
	id integer,
	username varchar(100),
	password varchar(100),
	customerName varchar(100),
	age varchar(100),
	sex varchar(100),
	phone varchar(100)
);
--读者字段加注释
comment on column t_customer.id is '主键';
comment on column t_customer.username is '账号';
comment on column t_customer.password is '密码';
comment on column t_customer.customerName is '姓名';
comment on column t_customer.age is '年龄';
comment on column t_customer.sex is '性别';
comment on column t_customer.phone is '电话';
--读者表加注释
comment on table t_customer is '读者';

图书借阅表创建语句如下:


create table t_jy(
	id integer,
	customerId int,
	tsId varchar(100),
	v1 varchar(100),
	v2 varchar(100),
	v3 varchar(100),
	v4 varchar(100),
	v5 varchar(100),
	v6 varchar(100)
);
--图书借阅字段加注释
comment on column t_jy.id is '主键';
comment on column t_jy.customerId is '读者';
comment on column t_jy.tsId is '图书编号';
comment on column t_jy.v1 is '图书名称';
comment on column t_jy.v2 is '借书日期';
comment on column t_jy.v3 is '应还书日期';
comment on column t_jy.v4 is '实际还书日期';
comment on column t_jy.v5 is '逾期罚款额';
comment on column t_jy.v6 is '借阅编号';
--图书借阅表加注释
comment on table t_jy is '图书借阅';

书架表创建语句如下:


create table t_sj(
	id integer,
	sjName varchar(100),
	v1 varchar(100),
	v2 varchar(100),
	v3 varchar(100)
);
--书架字段加注释
comment on column t_sj.id is '主键';
comment on column t_sj.sjName is '书架编号';
comment on column t_sj.v1 is '图书名称';
comment on column t_sj.v2 is '图书编号';
comment on column t_sj.v3 is '书库编号';
--书架表加注释
comment on table t_sj is '书架';

图书表创建语句如下:


create table t_ts(
	id integer,
	tsName varchar(100),
	v1 varchar(100),
	sjId int,
	v3 varchar(100),
	v4 varchar(100),
	v5 varchar(100),
	v6 varchar(100),
	v7 varchar(100),
	v8 varchar(100),
	numb int,
	pic varchar(100)
);
--图书字段加注释
comment on column t_ts.id is '主键';
comment on column t_ts.tsName is '图书编号';
comment on column t_ts.v1 is '书库编号';
comment on column t_ts.sjId is '书架编号';
comment on column t_ts.v3 is '图书名称';
comment on column t_ts.v4 is '图书价格';
comment on column t_ts.v5 is '出版社';
comment on column t_ts.v6 is '出版日期';
comment on column t_ts.v7 is '作者';
comment on column t_ts.v8 is '状态';
comment on column t_ts.numb is '数量';
comment on column t_ts.pic is '';
--图书表加注释
comment on table t_ts is '图书';

oracle特有,对应序列如下:


create sequence s_t_customer;
create sequence s_t_jy;
create sequence s_t_sj;
create sequence s_t_ts;

分布式架构的图书管理系统sqlserver数据库版本源码:

超级管理员表创建语句如下:


--超级管理员
create table t_admin(
	id int identity(1,1) primary key not null,--主键
	username varchar(100),--超级管理员账号
	password varchar(100)--超级管理员密码
);
insert into t_admin(username,password) values('admin','123456');

读者表创建语句如下:


--读者表注释
create table t_customer(
	id int identity(1,1) primary key not null,--主键
	username varchar(100),--账号
	password varchar(100),--密码
	customerName varchar(100),--姓名
	age varchar(100),--年龄
	sex varchar(100),--性别
	phone varchar(100)--电话
);

图书借阅表创建语句如下:


--图书借阅表注释
create table t_jy(
	id int identity(1,1) primary key not null,--主键
	customerId int,--读者
	tsId varchar(100),--图书编号
	v1 varchar(100),--图书名称
	v2 varchar(100),--借书日期
	v3 varchar(100),--应还书日期
	v4 varchar(100),--实际还书日期
	v5 varchar(100),--逾期罚款额
	v6 varchar(100)--借阅编号
);

书架表创建语句如下:


--书架表注释
create table t_sj(
	id int identity(1,1) primary key not null,--主键
	sjName varchar(100),--书架编号
	v1 varchar(100),--图书名称
	v2 varchar(100),--图书编号
	v3 varchar(100)--书库编号
);

图书表创建语句如下:


--图书表注释
create table t_ts(
	id int identity(1,1) primary key not null,--主键
	tsName varchar(100),--图书编号
	v1 varchar(100),--书库编号
	sjId int,--书架编号
	v3 varchar(100),--图书名称
	v4 varchar(100),--图书价格
	v5 varchar(100),--出版社
	v6 varchar(100),--出版日期
	v7 varchar(100),--作者
	v8 varchar(100),--状态
	numb int,--数量
	pic varchar(100)--
);

分布式架构的图书管理系统登录后主页

分布式架构的图书管理系统spring+springMVC+hibernate框架对象(javaBean,pojo)设计:

读者javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//读者
@Table(name = "t_customer")
public class Customer {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//账号
private String username;
//密码
private String password;
//姓名
private String customerName;
//年龄
private String age;
//性别
private String sex;
//电话
private String phone;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
}

图书借阅javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//图书借阅
@Table(name = "t_jy")
public class Jy {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//读者
private Integer customerId;
//图书编号
private String tsId;
//图书名称
private String v1;
//借书日期
private String v2;
//应还书日期
private String v3;
//实际还书日期
private String v4;
//逾期罚款额
private String v5;
//借阅编号
private String v6;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public String getTsId() {return tsId;}
public void setTsId(String tsId) {this.tsId = tsId;}
public String getV1() {return v1;}
public void setV1(String v1) {this.v1 = v1;}
public String getV2() {return v2;}
public void setV2(String v2) {this.v2 = v2;}
public String getV3() {return v3;}
public void setV3(String v3) {this.v3 = v3;}
public String getV4() {return v4;}
public void setV4(String v4) {this.v4 = v4;}
public String getV5() {return v5;}
public void setV5(String v5) {this.v5 = v5;}
public String getV6() {return v6;}
public void setV6(String v6) {this.v6 = v6;}
}

书架javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//书架
@Table(name = "t_sj")
public class Sj {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//书架编号
private String sjName;
//图书名称
private String v1;
//图书编号
private String v2;
//书库编号
private String v3;
public String getSjName() {return sjName;}
public void setSjName(String sjName) {this.sjName = sjName;}
public String getV1() {return v1;}
public void setV1(String v1) {this.v1 = v1;}
public String getV2() {return v2;}
public void setV2(String v2) {this.v2 = v2;}
public String getV3() {return v3;}
public void setV3(String v3) {this.v3 = v3;}
}

图书javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//图书
@Table(name = "t_ts")
public class Ts {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//图书编号
private String tsName;
//书库编号
private String v1;
//书架编号
private Integer sjId;
//图书名称
private String v3;
//图书价格
private String v4;
//出版社
private String v5;
//出版日期
private String v6;
//作者
private String v7;
//状态
private String v8;
//数量
private Integer numb;
//
private String pic;
public String getTsName() {return tsName;}
public void setTsName(String tsName) {this.tsName = tsName;}
public String getV1() {return v1;}
public void setV1(String v1) {this.v1 = v1;}
public Integer getSjId() {return sjId;}
public void setSjId(Integer sjId) {this.sjId = sjId;}
public String getV3() {return v3;}
public void setV3(String v3) {this.v3 = v3;}
public String getV4() {return v4;}
public void setV4(String v4) {this.v4 = v4;}
public String getV5() {return v5;}
public void setV5(String v5) {this.v5 = v5;}
public String getV6() {return v6;}
public void setV6(String v6) {this.v6 = v6;}
public String getV7() {return v7;}
public void setV7(String v7) {this.v7 = v7;}
public String getV8() {return v8;}
public void setV8(String v8) {this.v8 = v8;}
public Integer getNumb() {return numb;}
public void setNumb(Integer numb) {this.numb = numb;}
public String getPic() {return pic;}
public void setPic(String pic) {this.pic = pic;}
}

分布式架构的图书管理系统spring+springMVC+mybatis框架对象(javaBean,pojo)设计:

读者javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//读者
public class Customer  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//账号
private String username;
//密码
private String password;
//姓名
private String customerName;
//年龄
private String age;
//性别
private String sex;
//电话
private String phone;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
}

图书借阅javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//图书借阅
public class Jy  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//读者
private Integer customerId;
//图书编号
private String tsId;
//图书名称
private String v1;
//借书日期
private String v2;
//应还书日期
private String v3;
//实际还书日期
private String v4;
//逾期罚款额
private String v5;
//借阅编号
private String v6;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public String getTsId() {return tsId;}
public void setTsId(String tsId) {this.tsId = tsId;}
public String getV1() {return v1;}
public void setV1(String v1) {this.v1 = v1;}
public String getV2() {return v2;}
public void setV2(String v2) {this.v2 = v2;}
public String getV3() {return v3;}
public void setV3(String v3) {this.v3 = v3;}
public String getV4() {return v4;}
public void setV4(String v4) {this.v4 = v4;}
public String getV5() {return v5;}
public void setV5(String v5) {this.v5 = v5;}
public String getV6() {return v6;}
public void setV6(String v6) {this.v6 = v6;}
}

书架javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//书架
public class Sj  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//书架编号
private String sjName;
//图书名称
private String v1;
//图书编号
private String v2;
//书库编号
private String v3;
public String getSjName() {return sjName;}
public void setSjName(String sjName) {this.sjName = sjName;}
public String getV1() {return v1;}
public void setV1(String v1) {this.v1 = v1;}
public String getV2() {return v2;}
public void setV2(String v2) {this.v2 = v2;}
public String getV3() {return v3;}
public void setV3(String v3) {this.v3 = v3;}
}

图书javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//图书
public class Ts  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//图书编号
private String tsName;
//书库编号
private String v1;
//书架编号
private Integer sjId;
//图书名称
private String v3;
//图书价格
private String v4;
//出版社
private String v5;
//出版日期
private String v6;
//作者
private String v7;
//状态
private String v8;
//数量
private Integer numb;
//
private String pic;
public String getTsName() {return tsName;}
public void setTsName(String tsName) {this.tsName = tsName;}
public String getV1() {return v1;}
public void setV1(String v1) {this.v1 = v1;}
public Integer getSjId() {return sjId;}
public void setSjId(Integer sjId) {this.sjId = sjId;}
public String getV3() {return v3;}
public void setV3(String v3) {this.v3 = v3;}
public String getV4() {return v4;}
public void setV4(String v4) {this.v4 = v4;}
public String getV5() {return v5;}
public void setV5(String v5) {this.v5 = v5;}
public String getV6() {return v6;}
public void setV6(String v6) {this.v6 = v6;}
public String getV7() {return v7;}
public void setV7(String v7) {this.v7 = v7;}
public String getV8() {return v8;}
public void setV8(String v8) {this.v8 = v8;}
public Integer getNumb() {return numb;}
public void setNumb(Integer numb) {this.numb = numb;}
public String getPic() {return pic;}
public void setPic(String pic) {this.pic = pic;}
}

源代码下载点这里

评论