利用Mysql进行update时,出现You have an error in your SQL syntax check the manual that corresponds to your My
来源:互联网 发布:linux cp -r 编辑:程序博客网 时间:2024/06/07 20:08
总是出现You have an error in your SQL syntax check the manual that corresponds to your MySQL server version for the right syntax ...... at line 1错误。
代码如下:
ps = conn.prepareStatement("update admin set aid = ?,username = ?,password = ?,password2 = ?"
+ "where aid like ? ");
ps.setInt(1,admin.getAid());
ps.setString(2, admin.getUsername());
ps.setString(3, admin.getPassword());
ps.setString(4, admin.getPassword2());
ps.setInt(5, aid);
这段代码没有什么大问题,就是在update的语句中少了个空格!!!
在关键字where后面少了个空格,导致where和参数password2的值连在了一起,出现语法错误。
正确的代码是:
ps = conn.prepareStatement("update admin set aid = ?,username = ?,password = ?,password2 = ?"
+ " where aid like ? ");
- 利用Mysql进行update时,出现You have an error in your SQL syntax check the manual that corresponds to your My
- Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your My
- ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
- MySql-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL的问题
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- 错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- StringUtils的使用
- CreateProcess参数传递细节
- VC MFC菜单
- 利用批处理文件结束javaw.exe进程
- #define和typedef区别
- 利用Mysql进行update时,出现You have an error in your SQL syntax check the manual that corresponds to your My
- 织梦根目录标签汇总
- 深入浅出C指针(二)一维数组
- IT产业即将大变革,Microsoft将面临转型,Win8会失败吗?谁会是下一个IT帝国企业?
- C语言 指针连接两个字符串(一)
- 实例变量调用和变量
- C#常用函数和方法集
- iOS开发入门级别的教程及书籍,供参考。
- HTML5 音视频标签的方法、属性和事件