我是用 String id=new String(request.getParameter("id")); String title=new String(request.getParameter("title")); String content=new String(request.getParameter("content"));
String strSQL="update news set newstitle=“+ title + ”,set newscontent="+ content +“'where id=“+id;
更新数据库中数据时用news.executeUpdate(strSQL)
//news是自己编写的一个javaBean
报错::连接数据库失败了,异常为:[Microsoft][ODBC Microsoft Access Driver] UPDATE 语句的语法错误。
请问是怎么回事?
String strSQL="update news set newstitle='dfjeo',newscontent='jsdfow' where id="+id;这样时没问题的。
----------------解决方案--------------------------------------------------------
问题解决了,是我自己太粗心了。
竟然写了两个set。还有改为:
String strSQL="update news set newstitle='" + title + "', newscontent='"+ content +"'where id="+id;
----------------解决方案--------------------------------------------------------