Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example of Library Management system based on Java and MySQL

2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces an example of a book management system based on Java and MySQL, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

Java library management system

Project requirements

With the popularization of computer and the improvement of application level, after investigation and comparison, I decided to use my Java knowledge to develop a small book management system to facilitate the management of books.

Book management system is a typical information management system. This assignment uses JAVA development tools Eclipse and MySQL database to develop this book management system. The problems to be solved by the system can meet the basic requirements of book management, including adding, management and other functions. The system can provide readers with borrowing service quickly and conveniently according to the needs of users.

The library management system should have the following functions:

Reader library management

Bookstore management

Loan management

Reader information query

The library management system is mainly aimed at the operation function of the bookstore, so the system should try its best to meet the demand, and at the same time, there should be no redundant or complicated functions, which will confuse the operation and function of the system.

Project address

Address of this project: https://github.com/wangyunpengbio/Library/

Free download method: click "Clone or download", then click "Download ZIP". If you are interested, you can click Star.

If you are too beginner to download it, download https://download.csdn.net/download/qq_29300341/9667678 on csdn.

Demand analysis

a. Business processes:

No. Business process requirements 1. The librarian logs in to the system and the librarian needs to use the account number and password to log in. two。 Add new reader information, such as name, gender, position, etc. 3. Add new book materials, such as book title, price, type, etc. 4. The reader library management selects the reader information in the reader library, which can be updated and deleted. 5. Bookstore management can press "Book number query" and "Book title Fuzzy query", and then select book information, then update and delete books can be divided into library and loan management input reader number, you can review the reader's data and borrowed books, review customer data and purchase records. 7. Readers login to the system readers need to use account and password to log in. 8 borrow books according to the title of fuzzy search, select can borrow books 9 return books to review their own reader information and have borrowed books, click return, do not allow to change or delete reader data, only allowed to query, change and delete functions by the administrator.

The following is analyzed using the entity contact model-Entity Relationship.

b. Inductive entities and attributes

No. The attribute value of the entity corresponding to the business process is 1. The librarian logs in to the system LibrariannameUser password2. Add new reader materials ReaderidReader nameReader kind sex password3. Add Book Author PublisheridBook,nameBook,price,kind,author,publisher Author.name, Author.workplace Publisher.name, Publisher.address4. Reader library management ReaderidReader nameReader kind sex password5. Bookstore management BookidBook nameBook price kind autor publisher6. Loan Management BorrowidReader idBook lendDate dueDate overtime7. Readers log in to the system ReaderidReader password8 to borrow books, BorrowidReader idBook lendDate dueDate overtime9 to return books BorrowidReader idBook lendDate dueDate overtime

c. Model of entity

D.ER-entity relationship

Author,Publisher To Book&Borrow&Reader To Librarian

Design

In the project folder, (code total: 4800 + lines)

The doc folder holds the generated documentation comments, and you can click on the index file to view the comments for the entire project.

There are five packages under the Src package

Database is used to store database connection operations

Frame is used to store individual form interfaces

Model is used to store the data model corresponding to each entity (table).

Out_of_date is used to store the interface that was originally written, then abandoned and no longer called.

The addition, deletion, modification and search method of SqlTools for storing operation database

The image folder is used to store related interface pictures and button pictures.

Note: all the entrances to different interfaces of the program have been commented out, and MainFrame is the only entry to the program.

Program details design:

Password echo of the login interface, accompanied by jump animation (here multithreading is used to control thread survival time)

You can modify the data by selecting the table directly. When updating the data, there is the original data by default, and you can search for books in different ways.

When new borrowing information is added, the current time is automatically added and the return time is calculated. (SQL function NOW ())

Interface button, background redesigned with Photoshop, friendly graphical user interface

The design of the database reaches the third normal form, which removes the transmission trust dependence of all non-primary attributes on any candidate keywords, and the redundancy is low.

The naming of variables and methods conforms to the specification and is highly readable.

Different Model entities (tables) correspond to different SqlTools operations and are stored separately, which makes the program reusable and easy to expand.

Use

Import the SQL statement, select utf8 in the character set, otherwise you may not be able to display Chinese, and the database name is library

Create database library

It is recommended to use Mysql Front as the foreground of MySQL. Multiple sql statements can be executed together. Baidu can download it with the first link.

Http://dlsw.baidu.com/sw-search-sp/soft/6c/17997/MySQL-Front_V5.3.4.214_Setup.1435658094.exe

Add the database driver to the Java environment. The DatabaseTools.java file in the database package in the source program is about the database connection operation. The user name and password of the source program are root, and the database name is library. This code needs to be slightly changed to run on different computers.

Log in:

Librarian: user name root password root or wangyp password 123456

* * Reader: user name 001 password root * * (Note: the initial password values of readers in the database are all root)

If you use Eclipse on different computers, you may need to re-establish the path to the Java class library

This procedure is written with 1.8 jdk, so it is best to use 1.8 jre.

The code runs under 1.8 and does not even appear as a warning. 1.7 and 1.6 are not displayed well.

Both awt and swing rely on the specific implementation of virtual machines. So different platforms perform differently. If you use javafx, the interface can only be ported.

And the notebook computer used for writing is a high-split screen, the display size on this computer is just right, and the interface may be too large on other computers.

Specific documentation comments have been generated. Open the index file in the doc folder to view the comments for the entire project.

Thank you for reading this article carefully. I hope the article "examples of Library Management system based on Java and MySQL" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 216

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report