好久没在oracle版见到有websphere问题了,呵呵,没用好久,恐怕帮到你。
但调用存储过程的参数,要说明其类型大小,size,参数是in还是out,参数的数目.
把过程代码贴出来吧。题外话,为什么不用db2,那比较oracle更好性能.

解决方案 »

  1.   

    下面是通过直连方式连到ORACLE数据库的代码,运行正常。
     ArrayList aItoratorList = new ArrayList();
               Connection conn = null;
               oracle.jdbc.OracleCallableStatement stmt=null;
               ResultSet rs = null;
               String aStrSql = null;
               try {
              conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.166:1521:attend","attend","ok");
                      stmt = (oracle.jdbc.OracleCallableStatement)conn.prepareCall("{call p_party.sp_getAllParty(?)}");
                        stmt=conn.prepareCall("{call p_party.sp_getAllParty(?)}");
                       stmt.registerOutParameter(1,oracle.jdbc.OracleTypes.CURSOR);
                       stmt.execute();
                       rs=stmt.getCursor(1);但是如果通过WEBSPHERE连时出错,代码如下:ArrayList aItoratorList = new ArrayList();
               Connection conn = null;
               oracle.jdbc.OracleCallableStatement stmt=null;
               ResultSet rs = null;
               String aStrSql = null;
               try {
                if (ds == null) { getDataSource();//这是通过WEBSPHERE得到数据源的方法}
                      conn = getConnection();//得到连接的方法
                      stmt = (oracle.jdbc.OracleCallableStatement)conn.prepareCall("{call p_party.sp_getAllParty(?)}");
                      stmt=conn.prepareCall("{call p_party.sp_getAllParty(?)}");
                      stmt.registerOutParameter(1,oracle.jdbc.OracleTypes.CURSOR);
                      stmt.execute();
                      rs=stmt.getCursor(1);
    在执行stmt = (oracle.jdbc.OracleCallableStatement)conn.prepareCall("{call p_party.sp_getAllParty(?)}");语句时抛出例外com.ibm.ejs.cm.proxy.OracleCallableStatementProxy
    这是为什么,请大家指点。
      

  2.   

    包和包体代码如下:CREATE OR REPLACE  PACKAGE P_PARTY          is
     type outList is ref cursor;
     procedure sp_getAllParty(partyList out outList);
     end p_party;CREATE OR REPLACE  PACKAGE BODY P_PARTY    is
     procedure sp_getAllParty(partyList out outList)
     is
     begin
      open partyList 
        for select party_code,party_name from party_info;
      
     end;end p_party;
      

  3.   

    oracel存储过程返回结果集和驱动程序是密切相关的!!!建议从这方面仔细检查!