java调用oralce返回结果集

CallableStatement stmt = null;
    conn = DBManager.getConnection();
   
    stmt = conn.prepareCall("{call SP_WJDSCX_GET_WSBMX(?,to_date(?,'yyyy/mm/dd'),?,?)}");
    stmt.setString(1, id_jg + "%");
    stmt.setString(2, sssq);
    stmt.registerOutParameter(3,OracleTypes.CURSOR);
    stmt.registerOutParameter(4, java.sql.Types.VARCHAR);
    stmt.execute();
   
    rs = ((OracleCallableStatement)stmt).getCursor(3);
    allCount = new Integer(stmt.getString(4)).intValue() + 1;

你可能感兴趣的:(java,sql)