您的位置:程序门 -> ms-sql server -> 应用实例



sqlserver存储过程更新表中数据无效 急


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


sqlserver存储过程更新表中数据无效 急
发表于:2007-04-27 19:44:40 楼主
存储过程为:
create   procedure   updatevote(@vverygood   bigint,@vgood   bigint,
@vgenenal   bigint,@vbad   bigint,@vverybad   bigint   )  

  as
begin
update   product   set   v1=@vverygood,v2=@vgood,v3=@vgenenal,v4=@vbad,
v5=@vverybad
select   *   from   product
end
go

jsp中的调用方法如下:
product是表名,v1--v5是字段名
callablestatement   callablestatement   =   conn.preparecall(
                                                "{call   updatevote(?,?,?,?,?)} ");
                             
callablestatement.setint(1,1);
callablestatement.setint(2,1);
callablestatement.setint(3,1);
callablestatement.setint(4,1);
callablestatement.setint(5,1);
callablestatement.EXECuteupdate();
callablestatement.close();

目的是把product表中的v1到v5的值设置为1
执行过程中没有错误报告,但数据没有写到数据库中。
如果在jsp中紧接着查看更新的记录,会有结果,但就是写入不到数据库中。
请各们帮忙,看看哪里出了问题,急需!!!
发表于:2007-04-27 19:52:401楼 得分:0
不懂jsp   帮顶
发表于:2007-04-27 20:58:262楼 得分:0
procedure没有错,lz发错地方了
发表于:2007-04-27 22:59:243楼 得分:0
这个不懂!帮顶!!!
发表于:2007-04-28 15:23:354楼 得分:0
不用这个.
callablestatement.EXECuteupdate();
试一下
callablestatement.EXECute();
发表于:2007-05-01 21:54:375楼 得分:0
你在数据库里先试试存储过程啊,如果存储过程没错,那就是你jsp的问题了。


快速检索

最新资讯
热门点击