SQL command not properly ended 错误
来源:百度知道 编辑:UC知道 时间:2024/06/15 15:15:45
String sql = "update student set photo = ?,name = '"+name+"',sex = '"+sex+"',age = '"+age+"',classid = '"+classid+"',specialtyid = '"+subjetcid+"',addr = '"+addr+"') " +"where stuid = '"+stuid+"'";
stm = Conna.returnconnection().prepareStatement(sql);
stm.setBinaryStream(1, fis, length);
stm.executeUpdate();// 提示错误出在这里
该操作完成一个数据表的更新~ 语句应该没有问题 就是老是报这样的错误
已经确定所有的字段都已经赋值,单步到stm.executeUpdate();出错 并且无法打印其返回的INT值 救命啊~
stm = Conna.returnconnection().prepareStatement(sql);
stm.setBinaryStream(1, fis, length);
stm.executeUpdate();// 提示错误出在这里
该操作完成一个数据表的更新~ 语句应该没有问题 就是老是报这样的错误
已经确定所有的字段都已经赋值,单步到stm.executeUpdate();出错 并且无法打印其返回的INT值 救命啊~
这个当然有问题了,"photo" 没有赋值,如果photo字段不要更新的话,就去掉好了,如果要更新,请写明赋给它的值。肯定是你写的sql有问题,这样,你不是单步跟踪了吗,你可以把你那句sql语句打印出来的,System.out.println ("sql is:"+ sql)然后到数据库中去执行一下子,就知道错误在哪里了。
在addr后面多了一个“)”,应该是这个错误。
还有你的字段都是字符型的吗,干嘛都加引号呢,眼花缭乱的不便于正确书写SQL语句。
SQL中,用 Insert into插入提示SQL Command Failed
foxmail发送邮件出错502:command not implemented
如何创建Command对象来执行SQL语句
sql 语句中in ,not in
关于SQL语句not in不执行
Linux E企业版本 4.2的-bash:iostat:command not found
Linux系统输入命令RPM,系统提示RPM command not found
在LINUX中为什么会出现netconfig:command not found netconfig这个命令没有错啊
dos系统有个if 命令 具体格式: if [not] errorlevel number command
is not recognized as an internal or external command,operable program or batch file.