Enumeration class application (7/20)

Today's study notes


Application of enumeration class (Enum)

//编写枚举的类型,分为在读、休学、退学、删除,其中数值分别为1、2、3、4
READING(1,"在读"),
SUSPENSION(2,"休学"),
DROPOUT(3,"退学"),
DELETE(4,"删除");

//编写枚举类的表示方式,本文以:枚举类型(type,value)的方式举例
public final Integer type;
public final String value;
StudentEnum(Integer type,String value){
    this.type = type;
    this.value = value;
}

Today's bug modification


 After writing the code, I found that the deletion program did not delete the corresponding data in the expected way, and the pop-up "deletion failed" means that the returned update statement did not run successfully, and there was no corresponding error report on the console interface, which can be ruled out as code writing problem, so I started troubleshooting from the front-end code and the back-end database query statement.

I added an output statement to the running Servlet layer to view the data received from the front end, and found that the returned data was stuId instead of the stuNo I used in the SQL query statement. After changing from Dao layer it works fine.

Guess you like

Origin blog.csdn.net/qq152521766/article/details/118932343