com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘xxx‘ in ‘field list错误‘

运行时出现错误
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘bitch’ in ‘field list’
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘xxx‘ in ‘field list错误‘

错误原因:
我的sql语句的列名写错误了

数据库是这样的
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘xxx‘ in ‘field list错误‘
我写的sql是
String sql = “insert into customers(name,email,bitch)value(?,?,?)”
birth写成了bitch
改过后运行

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘xxx‘ in ‘field list错误‘

上一篇:截止到2021年,最全面499道Java面试题:JVM+分布式+算法+锁+MQ+微服务+数据库


下一篇:MQ消息中间件,面试能问写什么?