Java+JSP+Mysql+Tomcat实现Web图书管理系统
Posted 水坚石青
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java+JSP+Mysql+Tomcat实现Web图书管理系统相关的知识,希望对你有一定的参考价值。
图书管理系统
- 一、系统介绍
- 二、系统展示
- 三、代码实现
- Book
- User
- Record
- Comment
- BookShelf
- BookDao
- BookShelfDao
- CommentDao
- RecordDao
- UserDao
- BookService
- BookShelfService
- CommentService
- RecordService
- login.jsp
- login-do-info.jsp
- login-fail.jsp
- logout.jsp
- register.jsp
- register-do.jsp
- search-password.jsp
- search-password-do.jsp
- search-password-info.jsp
- admin-home.jsp
- admin-book-add.jsp
- admin-book-delete.jsp
- admin-book-update.jsp
- admin-user-add.jsp
- admin-user-delete.jsp
- admin-user-update.jsp
- user-home.jsp
- user-comment-add.jsp
- 四、其他
一、系统介绍
1.软件环境
IDEA:2018.2
Java:jdk1.8
mysql:8.0.13
Tomcat:8.5.23
2.功能模块图
3.系统功能
1.系统的注册、登录、注销
2.读者信息管理
系统管理员可以对读者信息进行查询、添加、修改、删除等操作。
3.图书信息管理
系统管理员可以对图书信息进行查询、添加、修改、删除等操作。
4.借阅信息管理
管理管理可以对借阅信息进行查询和删除操作,用户可以对借阅信息进行新增、查看操作。
5.个人书架管理
用户对个人书架的新增、删处、查看操作。
6.留言管理
用户可以对留言进行新增、查看操作。
4.数据库表
1.读者表
2.借阅信息表
3.评论留言表
4.图书表
5.书架表
5.工程截图
二、系统展示
1.系统注册
2.系统登录
3.找回密码
4.管理员-主页
5.管理员-用户管理主页
6.管理员-新增用户
7.管理员-修改用户
8.管理员-借阅信息管理
9.管理员-图书管理主页
10.管理员-新增图书
11.管理员-修改图书
12.用户-主页
13.用户-图书明细查看
14.用户-新增留言
15.用户-借阅信息管理
16.用户-书架管理
三、代码实现
Book
package com.sjsq.po;
import java.io.Serializable;
import java.util.Date;
/**
* @author shuijianshiqing
* @date 2020/5/19 22:40
*/
public class Book implements Serializable {
private static final long serialVersionUID = 1L;
private Integer bookid;
private String bookname;
private Double price;
private String author;
private String publish;
private Integer categoryid;
private String booklink;
private Date deadline;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Integer getBookid() {
return bookid;
}
public void setBookid(Integer bookid) {
this.bookid = bookid;
}
public String getBookname() {
return bookname;
}
public void setBookname(String bookname) {
this.bookname = bookname;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getPublish() {
return publish;
}
public void setPublish(String publish) {
this.publish = publish;
}
public Integer getCategoryid() {
return categoryid;
}
public void setCategoryid(Integer categoryid) {
this.categoryid = categoryid;
}
public String getBooklink() {
return booklink;
}
public void setBooklink(String booklink) {
this.booklink = booklink;
}
public Date getDeadline() {
return deadline;
}
public void setDeadline(Date deadline) {
this.deadline = deadline;
}
@Override
public String toString() {
return "Book{" +
"bookid=" + bookid +
", bookname='" + bookname + '\\'' +
", price=" + price +
", author='" + author + '\\'' +
", publish='" + publish + '\\'' +
", categoryid=" + categoryid +
", booklink='" + booklink + '\\'' +
", deadline=" + deadline +
'}';
}
}
User
package com.sjsq.po;
import java.io.Serializable;
/**
* @author shuijianshiqing
* @date 2020/5/19 22:19
* 用户的实体类
*/
public class User implements Serializable {
// 增加序列号,作用是反序列化的时候不会报错,切能进行IO的持久化
public static final long serialVersionUID = 1L;
private Integer userid;
private String username;
private String password;
private String email;
private String phone;
private Integer isadmin;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
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 getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Integer getIsadmin() {
return isadmin;
}
public void setIsadmin(Integer isadmin) {
this.isadmin = isadmin;
}
@Override
public String toString() {
return "User{" +
"userid=" + userid +
", username='" + username + '\\'' +
", password='" + password + '\\'' +
", email='" + email + '\\'' +
", phone='" + phone + '\\'' +
", isadmin=" + isadmin +
'}';
}
}
Record
package com.sjsq.po;
import java.util.Date;
/**
* @author shuijianshiqing
* @date 2021/5/22 22:05
* 借阅记录实体类
*/
public class Record {
private Integer borrowid;
private Integer userid;
private Integer bookid;
private String bookname;
private String booklink;
private Date borrowtime;
public Integer getBorrowid() {
return borrowid;
}
public void setBorrowid(Integer borrowid) {
this.borrowid = borrowid;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public Integer getBookid() {
return bookid;
}
public void setBookid(Integer bookid) {
this.bookid = bookid;
}
public String getBookname() {
return bookname;
}
public void setBookname(String bookname) {
this.bookname = bookname;
}
public String getBooklink() {
return booklink;
}
public void setBooklink(String booklink) {
this.booklink = booklink;
}
public Date getBorrowtime() {
return borrowtime;
}
public void setBorrowtime(Date borrowtime) {
this.borrowtime = borrowtime;
}
@Override
public String toString() {
return "Record{" +
"borrowid=" + borrowid +
", userid=" + userid +
", bookid=" + bookid +
", bookname='" + bookname + '\\'' +
", booklink='" + booklink + '\\'' +
", borrowtime=" + borrowtime +
'}';
}
}
Comment
package com.sjsq.po;
import java.sql.Time;
import java.util.Date;
/**
* @author shuijianshiqing
* @date 2021/5/22 17:18
*
* 留言表
*/
public class Comment {
private Integer commentid;
private Integer userid;
private String username;
private Integer bookid;
private String bookname;
private String comment;
private Date time;
public Integer getCommentid() {
return commentid;
}
public void setCommentid(Integer commentid) {
this.commentid = commentid;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getBookid() {
return bookid;
}
public void setBookid(Integer bookid) {
this.bookid = bookid;
}
public String getBookname() {
return bookname;
}
public void setBookname(String bookname) {
this.bookname = bookname;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
@Override
public String toString() {
return "Comment{" +
"commentid=" + commentid +
", userid=" + userid +
", username='" + username + '\\'' +
", bookid=" + bookid +
", bookname='" + bookname + '\\'' +
", comment='" + comment + '\\'' +
", time=" + time +
'}';
}
}
BookShelf
package com.sjsq.po;
import java.util.Date;
/**
* @author shuijianshiqing
* @date 2021/5/22 12:21
* 书架类
*/
public class BookShelf {
private Integer id;
private Integer userid;
private Integer bookid;
private String bookname;
private String booklink;
private Date adddate;
private Date removedate;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public Integer getBookid() {
return bookid;
}
public void setBookid(Integer bookid) {
this.bookid = bookid;
}
public String getBookname() {
return bookname;
}
public void setBookname(String bookname) {
this.bookname = bookname;
}
public String getBooklink() {
return booklink;
}
public void setBooklink(String booklink) {
this.booklink = booklink;
}
public Date getAdddate() {
return adddate;
}
public void setAdddate(Date adddate) {
this.adddate = adddate;
}
public Date getRemovedate() {
return removedate;
}
public void setRemovedate(Date removedate) {
this.removedate = removedate;
}
@Override
public String toString() {
return "BookShelf{" +
"id=" + id +
", userid=" + userid +
", bookid=" + bookid +
", bookname='" + bookname + '\\'' +
", booklink='" + booklink + '\\'' +
", adddate=" + adddate +
", removedate=" + removedate +
'}';
}
}
BookDao
package com.sjsq.dao;
import com.sjsq.po.Book;
import java.util.List;
/**
* @author shuijianshiqing
* @date 2020/5/20 23:13
* 图书信息接口
*/
public interface BookDao {
/**
* 查询图书信息
* @param sql
* @param arr
* @return
*/
public List<Book> select(String sql, Object[] arr);
/**
* 根据图书编号进行查询
* @param bookid
* @return
*/
public Book getBook(Integer bookid);
/**
* 图书新增
* @param book
* @return
*/
public boolean addBook(Book book);
/**
* 图书修改
* @param book
* @return
*/
public boolean updateBook(Book book);
/**
* 删除图书
* @param bookid
* @return
*/
public boolean deleteBook(Integer bookid);
}
BookShelfDao
package com.sjsq.dao;
import com.sjsq.po.BookShelf;
import java.util.List;
/**
* @author shuijianshiqing
* @date 2021/5/22 12:23
*/
public interface BookShelfDao {
/**
* 按照用户名检索书架
* @param userid
* @return
*/
public List<BookShelf> selectBookShelf(Integer userid);
/**
* 加入书架
* @param bookShelf
* @return
*/
public boolean addBookShelf(BookShelf bookShelf);
/**
* 移出书架
* @param userid
* @param bookid
* @return
*/
public boolean removeBookShelf(Integer userid,Integer bookid);
}
CommentDao
package com.sjsq.dao;
import com.sjsq.po.Comment;
import java.util.List;
/**
* @author shuijianshiqing
* @date 2021/5/22 17:21
*/
public interface CommentDao {
/**
* 添加留言
* @param comment
* @return
*/
public boolean addComment(Comment comment);
/**
* 展示留言
* @param bookid
* @return
*/
public List<Comment> selectComment(Integer bookid);
}
RecordDao
package com.sjsq.dao;
import com.<以上是关于Java+JSP+Mysql+Tomcat实现Web图书管理系统的主要内容,如果未能解决你的问题,请参考以下文章
IDEA+Java+JSP+Mysql+Tomcat实现Web商品信息管理系统
IDEA+Java+JSP+Mysql+Tomcat实现Web学生成绩管理系统
IDEA+Java+JSP+Mysql+Tomcat实现Web宠物信息管理系统