實體類與數據庫字段不匹配問題,java.sql.SQLSyntaxErrorException: Unknown column 'xxx' in 'field list&...

控制檯報錯 ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'field list' ### The error may exist in panfeng/mapper/StudentMapper.java (best guess) ### The error may involve panfeng.mapper.StudentMapper.selectByPrimaryKey-Inline ### The error occurred while setting parameters ### SQL: SELECT id,user_name,password,email FROM student WHERE id = ? ### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'field list' ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'field list'] with root cause java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'field list' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.16.jar:8.0.16]

 

瀏覽器報錯 Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue Aug 06 13:10:39 CST 2019 There was an unexpected error (type=Internal Server Error, status=500). ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'field list' ### The error may exist in panfeng/mapper/StudentMapper.java (best guess) ### The error may involve panfeng.mapper.StudentMapper.selectByPrimaryKey-Inline ### The error occurred while setting parameters ### SQL: SELECT id,user_name,password,email FROM student WHERE id = ? ### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'field list' ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'field list'

 

出錯的時候

 

 

修改以後,修改以後重啓,就能夠正常訪問了!!!

 

相關文章
相關標籤/搜索