问题描述
这是错误,
errorcom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:您的SQL语法中有错误;检查与MySQL服务器版本对应的手册,以便在第1行的'Desc,Author)值('jdsaklv','jdskalf','jsdalkf')附近使用正确的语法
,这是我的代码。我没有得到什么错误..请帮助。,
public boolean adddatablog(String name1,String Desc1,String Auth1)
{
boolean result = false;
PreparedStatement psmt = cn1.prepareCall(插入博客(名称,说明,作者)值(?,?,?));
psmt.setString(1,name1);
psmt.setString(2,Desc1);
psmt.setString(3,Auth1);
result = psmt.execute();
返回结果;
}
Here is the error,
errorcom.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 'Desc,Author) values('jdsaklv','jdskalf','jsdalkf')' at line 1
and here is my code.I am not getting what error is..please help.,
public boolean adddatablog( String name1,String Desc1,String Auth1)
{
boolean result = false;
PreparedStatement psmt=cn1.prepareCall("insert into blog(Name,Desc,Author) values(?,?,?)");
psmt.setString(1,name1);
psmt.setString(2,Desc1);
psmt.setString(3,Auth1);
result=psmt.execute();
return result;
}
推荐答案
这篇关于获取mysql查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!