我的存储过程时返回一个指针,里面是批量数据查询的结果。
    
    存储过程以及建包编译通过,贴出源代码:
    
        create or replace package cursorPackage as
            type outList is ref cursor; --定义游标  
        end cursorPackage;    
       create or replace package body cursorPackage as
          -- Function and procedure implementations
          PROCEDURE  getemps(io_cursor out outList)  is
    
          begin
              open io_cursor for select * from t_xwr_sys_role_info;           end getemps;
       end cursorPackage;    此存储过程以及建包编译都通过。    这里是JDBC源码:
    
         public static void main(String[] args) {
// TODO Auto-generated method stub
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.16:1521:orcl", "prosys", "prosys");

CallableStatement cs = conn.prepareCall("{call getemps(?) }");
cs.registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR);
ResultSet rs = cs.executeQuery(); while(rs.next()){
System.out.print(rs.getString(1));
System.out.print("   ");
System.out.print(rs.getString(3));
System.out.println();
}
}catch(Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}        红色内容为报错的地方,报错信息是:
        
        java.sql.SQLException: ORA-06550: line 1, column 7:
        PLS-00201: identifier 'GETEMPS' must be declared
        ORA-06550: line 1, column 7:
        PL/SQL: Statement ignored在网上找了不少教程,都是这样的写法,一走到execute方法,就会说过程名未定义,找不到之类的。
另外,我自己测试JDBC普通SQL查询,证明JDBC的数据库信息,用户名密码以及导JDBC包没有错误。
我尝试过不定义包,直接写存储过程调用,是可以的。
恳请大家帮忙查看一下,顺便请教下大家,存储过程放在包下面,调用的时候要注意什么。这个错的原因是我对包的理解不够