load_tfile = "{? = call load_tfile (?)}";
conn = DbConnectionManager.getConnection();
callableStatement = conn.prepareCall(load_tfile);
callableStatement.setString(1, task_id);
System.out.println(load_tfile);
System.out.println(task_id);
rs = (ResultSet) callableStatement.executeQuery();
created_time = rs.getString(1);
System.out.println(created_time + ".............");这个是我的jdbc调用存储过程create or replace procedure load_tfile(
       v_fileid in varchar2

is
v_tfile_creader varchar2(20);  
beginselect b.created  into v_tfile_creader from tfile b join
       (select t.fileid  from tfile t
       where t.mastertaskid = v_fileid
       order by t.created desc) a   on
        rownum=1 and b.fileid=a.fileid;            
end ;这个是我的存储过程 ! 存储过程我在pl/sql里面测试过是有结果!
在每次调用这个存储过程的时候页面就读取,一直都没有反映
点击其他的就白屏了!可是我的tomcat没有报错误!
从新启动tomcat进行其他操作是好的!就是调这个存储过程的时候就不行了!
请高手看看!谢谢!

解决方案 »

  1.   

    callableStatement.setString(1, task_id);
    这里不对,要给是你传入的参数:改为:callableStatement.setString(2, task_id);
    返回值的使用好像也不对吧?
      

  2.   

    callableStatement.executeQuery();
    这里好像应该是callableStatement.execute();
      

  3.   

    不是这么用的,在存储过程中将结果集用游标返回,也就是要有个游标类型的返回结果集
    在页面中要注册这个参数callableStatement.regist  (2, 参数类型为游标);这里的第二个参数是存储过程的输出参数,写的不完整,你自己用eclipse点出来就行了
      

  4.   

    CallableStatement callableStatement  = conn.prepareCall("{call load_tfile(?,?)}");
    callableStatement.setString(1,task_id);
    callableStatement.registerOutParameter(2,OracleTypes.CURSOR);你这么写试试看吧。