Jsp + servlet + mysql + ajax + Tomcat to realize book management system

The source code is on github: the source code
of the library management system The implementation of the library management system may be a bit difficult at first, but it will be relatively simple after drawing the problems separately. There is no front-end technology at all here, and the interface created is the best original. This project uses IDEA, the IDE, and only one jar package needs to be imported: mysql-connector-java-5.1.25-bin.jar, this jar package can use other versions, and this version is relatively old.
The directory structure is as follows 1. Analysis 1. The first is the design of the database, which can be obtained by simple analysis: three data tables are required, namely the rerader table for storing user registration information, the book table for storing book information, and the message table for users borrowing books. The reader table col includes: name, password, id, sex, telephone, email. The book table col includes: book_num (total number of books), book_name, book_writer, book_price, publish_time, publish_house (publisher). The message table col includes: name, book_name, date (when the book was borrowed). 2. Design javabeans according to the data table, including User, Message, and Book. 3. Create a library.properties file to prevent the user name or password from being changed in the future and directly modify the code, and operate the properties file directly. 4. Create a database-driven class JdbcUtils class, in which the functions include getConn(); used to obtain the Connection connection, and the close() function is used to close resources. 5. The next step is to analyze what kind of functions the library management system needs to achieve. a. There should be two links of registration and login on the index.jsp page, which are used by new and old users, and jump to different interfaces respectively.
FXc6KS.png







b. For users who have not registered, just register directly. After filling in the registration information, click the register button to complete the registration and jump directly to the login interface.
c. After logging in, there are the following links for users to click to check the status of various books in the library, borrow books, return books, log out, and check their borrowing status.
After several links in the d and c functions are linked to different interfaces, there are still links, which can be implemented in detail.
6. Implementation of each function in step 5
a. The dao layer that interacts with the database:
BookDAo, which implements the functions of adding books, updating the number of books, borrowing or returning books to see if there is a book.
MessageDAo, realizes the functions of checking the user's own borrowing status, returning a List, borrowing books, and changing the message table in the operations of returning books. The two basic implementations are very similar.
UserDAo, this is relatively simple, only the login function, the registration function, the function for checking whether there is a user name for ajax operation, and the function of listing all the books in the library at this time.
b, the realization of each jsp page.
Borrowing books: borrowBook.jsp, Borrowing success: borrowSuccess.jsp, Returning books: returnBook.jsp, Returning books successfully: returnSuccesss.jsp, Login: login.jsp, Logout: loginout.jsp, Registration: register.jsp, View User borrowing status: getmessage.jsp, show remaining books: showBooks.jsp.
The specific implementation is not stated here. The source code is on github: the source code of the library management system

Project results display:
insert image description here
SQL files have been placed on GitHub

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324134889&siteId=291194637
Recommended