以下是我的过程签名:

PROCEDURE sp_trx(i_arr_Sust  IN    T_TAB_SUST,
                            o_locator_map    OUT   SYS_REFCURSOR,
                            o_pkid_map   OUT   SYS_REFCURSOR,
                            o_error    OUT   VARCHAR2)


下面是我的ref游标里面的程序:

   OPEN o_locator_map FOR
    SELECT c_uuid,
          c_id,
          r_locator,
          TO_CHAR(cj_creation_date, g_dt_format) c_date,
          TO_CHAR(cj_last_modified_date, g_dt_format) cj_last_modified_date,
          version_number
    FROM tmp_locator_map;


以下是oracle中的数据类型:

c_uuid-->VARCHAR2(50 BYTE), c_id--> NUMBER, r_locator--> VARCHAR2(10 BYTE)


以下是我的Java程序流程:

String insertStoreProc = "{call PKG_LOADER.sp_trx(?,?,?,?)}";
CallableStatement callableStatement  = con.prepareCall(insertStoreProc);
            callableStatement.setObject(1, returninParam, 2003);
            callableStatement.registerOutParameter(2, OracleTypes.CURSOR);
            callableStatement.registerOutParameter(3, OracleTypes.CURSOR);
            callableStatement.registerOutParameter(4, java.sql.Types.VARCHAR);
            callableStatement.execute();
            Object obj_recordLoc = callableStatement.getObject(2);
            ResultSet rset =((OracleCallableStatement) callableStatement).getCursor(2);

            while (rset.next()){
                 String c_uuid = rset.getString(1);
                      }


现在的问题是我在rset.next()的下面提到了异常:


  java.sql.SQLException:ORA-08103:对象不再存在


请提示。
提前致谢

最佳答案

next() API指出以下内容:
When a call to the next method returns false, the cursor is positioned after the last row. Any invocation of a ResultSet method which requires a current row will result in a SQLException being thrown. If the result set type is TYPE_FORWARD_ONLY, it is vendor specified whether their JDBC driver implementation will return false or throw an SQLException on a subsequent call to next.
因此当光标到达ResultSet的末尾时,您可能会遇到此Exception

关于java - 获取SQL异常ORA-08103:Java中不再存在对象,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28736776/

10-09 06:14
查看更多