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

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

關鍵字 'current_date' 附近有語法錯誤。

運行后代碼顯示出

Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: 關鍵字 'current_date' 附近有語法錯誤。


public?class?GoddessDao?{


????public?void?addGoddess(Goddess?g)?throws?SQLException?{
???????????Connection?conn=DBUtil.getConnection();
???????????String?sql=""+"insert?into?imooc_goddess"+"(use_name,sex,age,birthday,email,mobile,"+
???????????????????"create_user,create_date,update_user,update_user,update_date,isdel)"+
???????????????????"values("+"?,?,?,?,?,?,?,current_date(),?,current_date(),?)";
???????????PreparedStatement?ptmt=conn.prepareStatement(sql);

???????????ptmt.setString(1,?g.getUser_name());
???????????ptmt.setInt(2,?g.getSex());
???????????ptmt.setInt(3,g.getAge());
???????????ptmt.setDate(4,new?Date(g.getBirthday().getTime()));
???????????ptmt.setString(5,g.getEmail());
???????????ptmt.setString(6,g.getMobile());
???????????ptmt.setString(7,g.getCreate_user());
???????????ptmt.setString(8,g.getUpdate_user());
???????????ptmt.setInt(9,g.getIsdel());

???????????ptmt.execute();
????}
????
????public?class?GoddessAction?{
????public?static?void?main(String[]?args)?throws?Exception?{

????????GoddessDao?g=new?GoddessDao();

????????Goddess?g1=new?Goddess();
????????g1.setUser_name("小夏");
????????g1.setAge(22);
????????g1.setSex(1);
????????g1.setBirthday(new?Date());
????????g1.setEmail("[email protected]");
????????g1.setMobile("18766888866");
????????g1.setCreate_user("ADMIN");
????????g1.setUpdate_user("ADMIN");
????????g1.setIsdel(1);

????????g.addGoddess(g1);

????????}
????}

這個問題怎么解決啊


正在回答

2 回答

jlt;=i:即是相當有一個寬度在變化的intpreg_match(string$pattern,string$subject,array?$match)

0 回復 有任何疑惑可以回復我~
"use_name"少了個“r”


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

舉報

0/150
提交
取消

關鍵字 'current_date' 附近有語法錯誤。

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

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

幫助反饋 APP下載

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

公眾號

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