Phase II Project Summary

Phase II Project Summary

  The second-stage project is to make a housekeeper accounting software.

  The housekeeper accounting software uses the subcontracting described above, and divides the entire project into Dao layer, Servive layer, Controller layer, and view layer for design.

  The code involved in adding, deleting, modifying, and checking the database is written in the Dao layer. The View layer controls the interface of the software and prompts the user to input various information. Then through the mutual calls between the various layers, the functions are realized.

  The second-stage project can not only consolidate the previous learning content, but also discover the large and small problems that occur in the process of coding. Among them, various exception types are very common in the process of writing code. This part of knowledge will be re-learned in the future learning process. Now I will introduce the solutions to common exceptions encountered in the process of solving code codes that I can think of without systematically learning exceptions.

  Since Java has a very complete error reporting mechanism, when we encounter a program exception, we can find out why the program throws this exception as long as we carefully check the exception information thrown by the program. The red part in the above figure is the exception information thrown by the system. After reading this part of the information, you can know that the program closed the Scanner prematurely. Therefore, the solution to this exception is to delete sc.close(); in the del method.

  There are also common exceptions, which are caused by SQL statement input errors. The modification method is to recheck the SQL statement and correct it.

    The reason for this exception is that I did not perform an exception throwing operation. The solution is to add an exception or put the method body in try{}catch(){}.

Guess you like

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