Resolution for inserting invalid columns when MySQL inserts data
- 2020-06-19 11:54:38
- OfStack
1. Error description
com.mysql.jdbc.exception:jdbc4.MySQLSyntaxErrorException:Unknown column 'man' in 'field list'
2. Error reason
Field in database table: sno sname sage ssex
When inserting data: sno sname sage man
Instead of inserting the field ssex with a value of "man", we changed man to the ssex field name
3. Solutions
When inserting, double quotes are applied to the field value of the string type