小弟现有一段存储过程代码(Sybase),作为String传过来,例如:
if exists (select colName from custSchema..tableName where colName = 'tempTable' )
drop table #tempTable
go
declare @age
select @age = 20
select * from custSchema..personTable where age = @age
select * from custSchema2..regTable where age = @age现在的需求是想用java直接解释这段存储过程代码,并获得返回值,有什么办法么?
谢谢各位啦

解决方案 »

  1.   

    若要返回值,必须用存储函数
    你这个问题,网上很多,随便百度就有!
    输入关键字  java  存储过程
      

  2.   

    存储过程中定义一个输出参数,在Java中直接调用存储过程就行了
      

  3.   

    在我的博客里写过调用存储过程的程序,有时间你可以去看看,对你应该有帮助http://user.qzone.qq.com/67622728
      

  4.   

    Connection conn=null;
        CallableStatement toesUp = null;
       conn = common.ConnectDataBase.getConnection();
       toesUp = conn.prepareCall("{call abc('"+ planlotid+ "') }");
             toesUp.execute();
             toesUp.close();
      

  5.   

    不好意思,错误理解楼主意思了,楼主是要怎么执行这么String是吧?
    对这个需求比较好奇啊,一般做法都是数据库中建立好存储过程之后,java去调用他,新建也要通过java,这个是的确没有接触过,等待高手解答
      

  6.   

    看看这个网站 www.xun-ku.cn 吧,绝对能找到你想要的,提供计算机教学视频的网站,是网上最大的计算机教学视频网站了,速度极快,还可以留言找自己想要的视频呢! 希望对你有所帮助!!!