201771010102- Chang Hui-cut experiment two personal projects - "Northwest Normal University student epidemic reporting system" project report

project content
Course class blog link https://edu.cnblogs.com/campus/xbsf/nwnu2020SE
This job requires link https://www.cnblogs.com/nwnu-daizh/p/12416880.html
My course learning objectives Development of the project to achieve the project by hosting github
This job helped me achieve learning objectives in what areas Excel connection sql server, Java connection sql server
Github repository project link address https://github.com/banmianzhuang02

A task

Daily epidemic reporting subsystem experience

  Initially the epidemic daily reporting subsystem design content is not perfect, there is also need to fill it again every day personal information when filling out the information. However, late this issue is resolved. But the situation can not be submitted in the near future when reporting, time does not exceed submission time, but the reality submit an exception.

Task II

Summary read "Building the Law" Section 1-2, in conjunction with Chapter 2, Section 2.3 PSP process, develop a mind of your own, Northwest Normal University students daily epidemic reporting system. You can select a project to complete development tasks in the following two types of development requirements

  I chose the first class project development

The first development requirements:
  a data file, saving 100 days 2000 faculty / student all immunization information, please design a command line program that supports queries in person one day the epidemic situation, some kind of query data Week epidemic statistics / month, and displays statistical results histogram.
The second category development requirements:
  1. The system can collect student epidemic valid information;
  2. The system enables users to use online;
  only once 3. fill a day, can not be modified after submission, ten o'clock daily epidemic information reporting deadline;
  4. Each after college designated authority sign-in system to view aggregate data of this college students to fill, you can click to see students Information, contact the class teacher, college student person responsible for verifying all hospital data, the data will be submitted to the school prevention and Control Office;
  5. school prevention and control of a designated person responsible Login "Northwest Normal epidemic prevention and control statistical information" subsystem, you can browse a list of all students completing the summary data, is available through the [export] epidemic EXCEL file data.

Project development background

  The end of December 2019, China Wuhan happen novel coronavirus (2019-nCoV) infected with pneumonia epidemic in order to curb the spread of the epidemic, effectively cut off the transmission of the virus, under the guidance of the central government, government departments at all levels to take a series of prevention and control measures: since 2020, at 10:23 on January Ri Wuhan "closed city", 31 provinces and municipalities have also implemented strict control measures; provinces and cities nationwide to send medical teams to participate in rescue work and Wuhan, Hubei; deployment in the country masks, protective clothing, medicines and other urgently needed medical resources to support Wuhan; to guide and supervise enterprises with production qualification of medical supplies across the country to resume production capacity as soon as possible; directed special financial allocation of funds for disease prevention and control; Wuhan guarantee supplies from other provinces to mobilize people's daily lives.
  It is worth mentioning that the Chinese Internet companies played an important role in the governance of social epidemic prevention and control. Tencent, for example, about the response to the outbreak control needs to develop a dozen a product. Where the epidemic online inquiry function, to reduce the mutual cross-infection between patients with fever have an important role in patients at home through the Internet Dr. Xiang Zaixian inquiry, reduces the risk of transmission of the virus or infection; rumor smash for the public to take a rational attitude towards the epidemic the development of great significance. Wuhan travel drops also set up a special team to serve the commuter medical staff, which plays an important role in the implementation of Wuhan traffic control. In addition, the new pneumonia patients diagnosed with stroke query tool, users only need to enter their own time by public transport and trips, you can confirm whether the infection was diagnosed counterparts, ahead of self-isolation and treatment work. In epidemic prevention and control, the Chinese Internet companies not only grow in terms of social responsibility has become increasingly mature.
  Collection, statistics and troubleshooting information about the epidemic prevention and control mechanism for effective cooperation, our school has developed a faculty / student epidemic reporting system to report daily by the staff of the epidemic, the epidemic of students reported daily, daily epidemic secondary sector summary table, four statistical reporting epidemic prevention and control subsystems. To achieve the basic situation of our school all categories of personnel, the regions and information gathering activities and track health. Teachers and students access to the system for remote reporting of information by our university enterprise micro-channel service hall.

demand analysis

  2020 January 30, has been in January more than from Wuhan outbreak occurred in December 2019, Wuhan January 23 isolation has been eight days, according to the World Health Organization, as of January 31, although the world (except China outside) found that the number of countries novel coronavirus 2019-nCoV infections now stands at 18 countries a total of confirmed cases to 82 cases, but mainly sporadic cases, deaths and community by not occur.
  China is the fastest build three hospital emergency sexually transmitted diseases, which Huanggang "Xiaotangshan" hospital - Dabie Mountain Regional Medical Center was put into use on January 28, can accommodate 1,000 beds; currently under construction in Wuhan Vulcan Hill hospital is 34,000 square meters, 1000 beds, Raytheon Hill hospital 75,000 square meters, 1500 beds, from start to delivery are within 10 days, will be held on February 3 and 5 put into use.

- quote from " China to fight the new coronavirus: the progress and impact ."

  In this case, the statistical information on the epidemic, query, graphical data display is imminent, we urgently need quick and easy statistical data and query epidemic simple software program or system of disease information, disease information for further monitoring and observation of progress and prediction.

feature design

basic skills:

  <1>, using excel data entry.
  <2>, sql import excel statistical tables.
  <3>, java connection sql.
  <4>, java realize data query
  <5>, java achieve histogram
  <6>, exit the program

Design and Implementation

Test Run

The data in Excel

Excel data import sql server

Database information inquiry

java database connection

Paste feel satisfied or relatively unique code snippet, with control to display the code blog garden
package helloeclipse;
import java.sql.*;

class HelloWorld {

  public static void main(String [] args)
  {
     String driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver";
     String dbURL="jdbc:sqlserver://localhost:1433;DatabaseName=information";  // studentmanager为数据库名

     String userName="sa";   // 登录账户名
     String userPwd="19980909";   // 密码

     try
  {
     Class.forName(driverName);
     Connection dbConn=DriverManager.getConnection(dbURL,userName,userPwd);
     System.out.println("连接数据库成功");
  }
     catch(Exception e)
  {
     e.printStackTrace();
     System.out.print("连接失败");
  }
}

}

  During the experiment, the multiple introduction of packet generation pattern histograms, pie charts and the like, guided into the failed. So subsequent experimental operation has not been done, but there is no jar package program displays a lot of mistakes.



to sum up

  During the experiment, the problem appears to download the software above, at first did not sql server and office and computer software java eclipse of the above, due to the recent developments in the case, there is no way to start the download various software, due to the early time mishandled, Download the wrong version of the software, plus the addition of a number of other download software, such as MySQL, Microsoft Visual studio 2019 software, etc., that time is enough, do not pay attention, and finally install jar package to generate a histogram of the import repeatedly error, but the link database before importing jar no problem, several attempts have not changed does not come out, only reluctantly give up for the time being.

Display PSP
PSP2.1 SUMMARY Plan time (min) required to complete a total of The actual time required for completion (min)
Planning plan 10 10
Estimate It estimated that the task requires much time and planning generally work steps 360 240
Development Develop 360 480
Analysis Needs analysis (including learning new technologies) 90 90
Design Spec Generate design documents 60 60
Design Review Design review (and colleagues reviewed the design documents) 90 120
Coding Standard Code specifications (development of appropriate norms for the current development) 360 120
Design Specific design 120 100
Coding Specific coding 500 60
Code Review Code Review 60 10
Test Test (self-test, code changes, commit changes 60
Reporting report 60 60
Test Report testing report 30 20
Size Measurement Computing workload 10 20
Postmortem & Process Improvement Plan Later summarized, and process improvement plan 10 10
Code specification

Code specification (since using a Java, this specification only the java Code)

  <1>, naming convention: For temporary variables can be used to improve the efficiency of short variable names for the member variable, as far as possible reflect its meaning from the variable name.
  <2> style file specification: focus on the right to fill in the comment.
  <3>, coding format: this can be achieved through a number of tools. For example jalopy.
  <4>, the preparation of standardized procedures: for volume reduction and speed considerations, specific programming skills and attention to some small point, to note that, where the rule itself would not collide, fish and bear's paw, determined according to system requirements trade-offs.

Naming conventions

  a, generally do not use the package, wasted.
  b, Class naming (Class names must be lowercase letters and the other from the start with an uppercase letter-word); named Class variables (variable names must start with a lowercase letter after the word begin with a capital letter.).
  c, Static Final Variable naming (Static Final Variable names should be capitalized, and pointed out that the full meaning.)
  d, the parameter name (the name of the parameter must be the same specification and naming variables).
  e, named array (array should always be named in the following manner).
  f, byte [] buffer; instead of byte buffer [];
  parameter g, the method (use meaningful parameter name, if possible, and use the fields to be assigned the same name).
  h, Java document style (all of Java (*. java) files must comply with the following style rules)

Copyright Information

Java copyright information must be at the beginning of the file, for example:
/ ** * Copyright ® 2000 XXX Co. Ltd. * All right Reserved. /
Additional information does not need to appear in the javadoc may also be included in this.
The Package / Imports
Package row to row before import, import standard package before the local name to the package name, and in alphabetical order. If the import line contains subdirectories of the same package, then it should
be handled.

Note class is used to explain the general class
/ ** * A class representing a set of packet and byte counters * It is observable to allow it to be watched, but only * reports changes when the current set is complete * /

Class defines, implements and extends included in different rows
CounterSet extends Observable implements public class Cloneable

Member variable class
public member variables must generate a text file (JavaDoc). proceted, private and package variables if the names of members of defined meaning clear, you can not comment.

The method of accessing
method of accessing a class variable, it is simply used to obtain the value of the class variable assignment, you can simply write on one line.

Constructors
It should be written in an incremental manner (for example: parameters and more written on the back).
Access type ( "public", "private", etc.) and any "static", "final" or "synchronized" to be in a row, and the method and parameters to write another line, such a method and parameters can be easier to read.

The method of class
codes should unix format, instead of the windows (for example: Enter into carriage return + line)
must be generated by the document class javadoc. Not only because it is a standard, which is recognized by all the various java compiler methods.
Indentation should be four spaces per line. Do not save Tab characters in the source file. When using different source code management tools Tab characters will be different because the user settings and extended to different widths.
If you use UltrEdit as your Java source code editor, you can disable save Tab character by operations, methods by UltrEdit the first set length of Room 4 spaces Tab use, and then use Format | Tabs to Spaces menu convert Tab to spaces.
After the page width should be set to 80 characters. Source code is generally not exceed this width, and results in not fully displayed, but this setting may be flexibly adjusted. In any case, should a long sentence or a comma operator wrap. the latter statement is wrapped, it should be indented two characters than the original statement.
{} Statements should as a separate line.
} If statement should be retracted into its corresponding row that {aligned position.
There should be no spaces between the left parenthesis after a character and, likewise, should not be any space between the right parenthesis and the previous character.
Do not use meaningless in the statement parentheses, brackets should only be out now to achieve some purpose source code.

Programming specification
  a, new keywords, and if you do, as far as possible in the loading phase, then the system memory more free time. Do not use new string ( "aaaa").
  B, convection object, must ensure in any case can be closed, e.g., in the closed finally {}.
  C, when calling getClass () method, the best possible use of existing static instance of the object, rather than a new object instance recall.
  d, with System.arraycopy () copies the array, instead of copying for loop.
  E, is the amount for a string, instead of using stringbuffer string.
  F, for a constant string, instead of a string stringbuffer.
  g, optimized for simple if else.
  h, try not to cycle in for (call methods) site. Similarly, the vector.size () be array.length changed, the same approach. EXAMPLE.
  i, to declare a new variable name in {} in the loop: EXAMPLE.
  j, Final member variable of the best plus static.
  k, Comparative single character string, using 'charAt ()' instead of 'startsWith ()'.
  l, stringbuffer preferably specified initial capacity.
  m, for the string concatenation, rather than "" wherein individual characters ''.
  n, "try / catch / finally " blocks to be placed outside the loop.
  O, rather than try to stack variables with instance variables and class variables, the speed can be increased.
  p, instead of the shift of a power of 2, multiplication and division.
  q, do not use the introduction of an anonymous class instead implement the interface.
  r, large arrays do not directly declare and initialize.
  s, not to return an object instance, and to return to an index.
  t, the initialization of large arrays, the best OutOfMemoryError exception checking.

Post-modification program

Import jar package

java package directory

Screenshot operation

Generate histograms

to sum up

  The project developed from the beginning not the slightest clue, to practice later during ideas become clearer. I concluded that there are no clear idea of the direction and specific, hands should give it a try, often said to be "Knowledge and Action", "Knowledge and Action" is not enough to convince the people alone have the know, there are single ignorance is no row direction. That is the unity of knowledge and action, between knowledge and action needed accompanied by the line, so perhaps is the best way to learn. Perhaps you are thinking is not very clear, but the hands-on, step by step, the issue may find a correct step by step, learn some experience, the quickest way is to find learning from the experience of others, but the good of their own learning thinking.
  I learned a lot of content here then do not do a detailed explanation. Before the program did not come out a jar package is not turned in, stay a day later, turn on the computer, hands tried MySQL jar package, and finally guided into, so the program will eventually run out, the code is uploaded to github code hosting platform (initially sql server using the data stored, but when introduced late corrected sql jar package, so the direct connection with the java sql, the last run the program editor).

Guess you like

Origin www.cnblogs.com/hongyanohongyan/p/12536004.html