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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

怎么一直報Exception in thread "main"

怎么一直報Exception in thread "main"

qq_lol_9 2017-03-24 16:15:11
public void testadd(Test t) throws Exception{ Connection conn= jdbcghy.getConn(); String sql="insert into test(NAME,STATUS,CREATE_TIME)valus(?,?,?)"; PreparedStatement pst= conn.prepareStatement(sql); pst.setString(1, t.getName()); pst.setString(2, t.getStatus()); pst.setDate(3, new Date(t.getCreateTime().getTime())); pst.execute(); }
查看完整描述

2 回答

?
qq_lol_9

TA貢獻3條經驗 獲得超36個贊

還報?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 'valus('6347','0','2017-03-24')' at line 1

查看完整回答
反對 回復 2017-03-24
?
qq_沙漠之花_0

TA貢獻1條經驗 獲得超0個贊

throws Exception 因為你把異常扔出去了! ?你在這個testadd(Test t) ?方法中 try catch ?一下 捕捉一下這個異常 在看看問題是出在什么地方

查看完整回答
反對 回復 2017-03-24
  • qq_lol_9
    qq_lol_9
    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 'valus('6347','0','2017-03-24')' at line 1 還報這個,我照著視頻敲的??!
  • 2 回答
  • 0 關注
  • 4049 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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