Java连接Mysql数据读写出错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in you

com.mysql.jdbc.exceptions.jdbc4.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 ‘order where money=‘4.00’’ at line 1
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)

错误原因:字段冲突,比如表名使用了order,这个是个预留字段,不允许用户自定义表的,改一下此类即可

猜你喜欢

转载自blog.csdn.net/qq_41170600/article/details/105858087
今日推荐