Java implementation of student status management system

This tutorial shares the specific java code of the student status management system for your reference. The specific contents are as follows

1. Demand analysis

1.1 system function design

(1) Be able to query the basic information of students, such as student number, name, age, class and gender; (2) be able to add, delete, search and modify the student information in the form; (3) be able to save the data to the MySQL database and record it; (4) be able to update the data through the MySQL database

1.2 system module design

The student status management system includes adding information module, deleting information module, modifying information module, querying information module and updating data module. System managers can query students' student number, name, gender, age, awards and other information. (please refer to Appendix 2 for specific system structure design E-R diagram)

2. System implementation

The system uses Java / JDBC language programming method to realize student status management. Using java to implement MySQL database, this technology mainly uses the import JDBC Jar, which enables Java programmers to freely call standard database access classes and interfaces. The combination of JDBC and Java makes it easy for users to use SQL statements to realize most of the database operations, and Java is easy to transplant. It is suitable for the characteristics of a variety of operating systems and can meet the needs of users with JDBC.

2.1 main layout documents

According to the principle of "one thing, one place", the layout of the program is carried out, and relevant documents are written for users to read. The data in MySQL can also be exported to the "studinfo. TXT" file for users to print or consult. JDBC adopted is 5.0 Version 8. 2.2 code of key interface segment and its annotation

2.2 Dao interface

//For detailed SQL statements and code implementation, please refer to the notes in the appendix on the next page!

2.3 design method

The singleton design mode is adopted. When designing the addition, deletion, query and modification functions respectively, the database is called independently to avoid the trouble of maintaining the software in the later stage. The software takes the function of connecting the database independently as a class, which only needs to be called in the later stage, without repeatedly realizing a large section of database connection code and reducing code redundancy, It is conducive to the further improvement of the later system and easy for other programmers to read.

(for the convenience of teachers, only a single example of SQL conncet connection is shown below!)

2.4 the interface is displayed at the bottom of the interface. The functions of adding, deleting, modifying and importing can be realized by clicking the button. In the filling box below, you can enter the student ID to realize the query function (here, it is assumed that the ID is the only primary key of the system, and press enter to trigger)

3. System defects

There are many bugs in the system. For example, when importing and exporting data, the empty line between the new data and the old data cannot be eliminated. When inserting a new student number, it may cause conflict with the old student number, resulting in the automatic shutdown of the software. Generally speaking, there are still many improvements, and it is hoped to be further repaired. Secondly, the entity of the software designed this time is only one student, which is relatively single, so the implementation is not too troublesome, but there is not much room to add the implementation of E-R diagram and other designs learned in class to the investigation. It is hoped that the query among students, courses and teachers can be realized in winter vacation, so as to further improve the system.

4. Advantages and disadvantages of file system implementation and database implementation

The file system is oriented to an application program, with poor sharing, large redundancy, poor data independence, structure in the record and no structure as a whole, which is controlled by the application program itself.

The database system is oriented to the real world, with high sharing, low redundancy, high physical independence and certain logical independence. It is overall structured and described by data model. The database management system provides data security, integrity, concurrency control and recovery ability. Improved data sharing; Reduce the redundancy of data and improve the consistency of data; Adopt a certain data model to realize data structure; The data is uniformly managed and controlled by DBMS, which is more conducive to the operation and use of non computer people and reduces the learning cost. With the development of database technology and the use of today's software, users are not aware that their software is using database functions.

Appendix 1: the SQL statements in the code snippet realize addition, deletion, query and modification (the implementation of the functions is relatively the same. The first update, add and delete functions are shown here, so the cumbersome code will not be displayed repeatedly, and only the key code will be listed for reference)

1. Implementation of update

2. Delete implementation code (the format and class establishment are the same as 1, and you can change the SQL statement)

3. Add implementation code

4. Query implementation (query according to ID)

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>