com.mysql.jdbc.PreparedStatement@a806a9: insert into leave (employeeid,name,startime,endtime,appreason) values ('G2014565','李丽','2020-06-09','2020-06-11','肠胃炎,需看医生。')com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave (employeeid,name,startime,endtime,appreason) values ('G2014565','??????','' at line 1
写了条insert语句准备插入表中,结果出错,后来百度,查到是关键字冲突,因为不确定,然后把字段名改了一个,还是不对。
最后发现是表名leave的原因,改了之后,就能正常运行了。