位置: IT常识 - 正文
推荐整理分享Java+JSP+Mysql+Tomcat实现Web图书管理系统,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
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.用户-书架管理三、代码实现Bookpackage 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 + '}'; }}Userpackage 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 + '}'; }}Recordpackage 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 + '}'; }}Commentpackage 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 + '}'; }}BookShelfpackage 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 + '}'; }}BookDaopackage 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);}BookShelfDaopackage 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);}CommentDaopackage 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);}RecordDaopackage com.sjsq.dao;import com.sjsq.po.Record;import java.util.List;/** * @author shuijianshiqing * @date 2021/5/22 22:07 */public interface RecordDao { /** * 查询所有借阅信息 * @return */ public List<Record> selectRecords(); /** * 查询借阅信息 * @return */ public List<Record> selectRecord(Integer userid); /** * 新增借阅记录 * @param record * @return */ public boolean addRecord(Record record); /** * 删除借阅记录 * @param borrowid * @return */ public boolean deleteRecord(Integer borrowid);}UserDaopackage com.sjsq.dao;import com.sjsq.po.User;import java.util.List;/** * @author shuijianshiqing * @date 2020/5/20 22:10 * 创建一个接口用于友情链接: 武汉网站建设