update方法我傳了last_edit_time字段傳入了new Date(),但是報錯了,更新不了
Caused?by:?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?'last_edit_time='2019-02-01?11:07:02.26'?????????WHERE?area_id=7'?at?line?4 at?sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native?Method) at?sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at?sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at?java.lang.reflect.Constructor.newInstance(Constructor.java:408)
我看到傳入的date多了小數點,于是把小數點去掉后再轉成date類型的,發現也不行,也報這個錯誤,后面的時間是沒有小數點的,我數據庫的版本是5.7,這個問題怎么解決呢
2019-02-13
我也是這個問題
2019-02-02
確認是java的date還是sql的date