亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

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,這個問題怎么解決呢

正在回答

2 回答

我也是這個問題

0 回復 有任何疑惑可以回復我~

確認是java的date還是sql的date

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

update方法我傳了last_edit_time字段傳入了new Date(),但是報錯了,更新不了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號