如题,谢谢!

解决方案 »

  1.   

    OracleType.Cursorhttp://java.chinaitlab.com/JDBCJDO/38254.html
      

  2.   

    游标返回的就用resultset就可以了。例如
    CallableStatement cs = null; 
    cs = conn.prepareCall(sql); 
    cs.setInt(1,oneParamIn); 
    cs.setInt(2, twoParamIn); 
    cs.registerOutParameter(3,oracle.jdbc.OracleTypes.CURSOR); 
    cs.execute(); 
    rs = (ResultSet)cs.getObject(3);
      

  3.   

    ICallableStatement cs = null;
    ResultSet rs = null;
    try {
    cs = DbFactory.getInstance().getCallableStatement("CARTOON",
    "{ call getCost(?,?,?)}");
    cs.setString(1, "select count(*) from test");
    cs.setBigDecimal(2, new BigDecimal("0"));
    cs.registerOutParameter(3, OracleTypes.CURSOR);
    cs.executeQuery();
    rs = (ResultSet) cs.getObject(3);
    while (rs.next()) {
    System.out.println(rs.getString("SOC"));
    }
    } catch (Exception e) {
    throw new EipException(e);
    } finally {
    try {
    if (rs != null) {
    rs.close();
    }
    if (cs != null) {
    cs.close();
    }
    } catch (SQLException e) {
    throw new EipException(e);
    }
    }