JAVA Array sizes - how to expand + See nice example code

Hi, We are returning tables of VARCHAR, NUMBERS, BOOLEANs and
the like to Java using PL2JAVA and Oracle Sessions. Problem I am
having is the size of the Array's are undetermined, but it
appears these must be set before calling package - if package
returns more rows in tables than the calling Java arrays have,
then it fails. If we assign too many then I guess we are using
memory which will be wasted - important when this system could
have 100 simultaneous users/connections.
Has anyone got any advice - people may find the sample code below
useful at worse.
PACKAGE INTERFACE:
FUNCTION ssfk_get_metadata.ssfp_get_2metadata RETURNS VARCHAR2
Argument Name Type In/Out
Default?
P_USER_PERSON_ID NUMBER(10) IN
P_SELF_SERVE_APPLICATION VARCHAR2 IN
PT_DATA_SOURCE TABLE OF VARCHAR2(60) OUT
PT_PROMPT TABLE OF VARCHAR2(30) OUT
PT_DATA_TYPE TABLE OF VARCHAR2(30) OUT
PT_DATA_LENGTH TABLE OF NUMBER OUT
PT_DECIMAL_PLACES TABLE OF NUMBER OUT
PT_MANDATORY_IND TABLE OF VARCHAR2(1) OUT
PT_UCASE_IND TABLE OF VARCHAR2(1) OUT
PT_DISPLAY_ONLY_IND TABLE OF VARCHAR2(1) OUT
PT_WEB_LINK_CD TABLE OF VARCHAR2(10) OUT
P_TABLE_INDEX BINARY_INTEGER OUT
P_MESSAGE_NUM NUMBER(5) OUT
Code example:
public static String getApplicationMetaData (String
strPersonID, String strApplication, Session sesSession)
String strClientString = "";
if (sesSession==null)
return "CONNECTION ERROR";
else
Double dblUser = new Double(strPersonID);
//initialising of IN parameters
PDouble pdbUserPersonId = new PDouble
(dblUser.intValue());
PStringBuffer pstSelfServeApplication = new
PStringBuffer (strApplication);
//initialising of OUT parameters
PStringBuffer pstDataSource[] = new PStringBuffer
[intArraySize];
PStringBuffer pstPrompt[] = new PStringBuffer
[intArraySize];
PStringBuffer pstDataType[] = new PStringBuffer
[intArraySize];
PDouble pdbDataLength[] = new PDouble [intArraySize];
PDouble pdbDecimalPlaces[] = new PDouble
[intArraySize];
PStringBuffer pstMandatoryIND[] = new PStringBuffer
[intArraySize];
PStringBuffer pstUCaseIND[] = new PStringBuffer
[intArraySize];
PStringBuffer pstDisplayOnlyIND[] = new PStringBuffer
[intArraySize];
PStringBuffer pstWebLinkCode[] = new PStringBuffer
[intArraySize];
PInteger pinTableIndex = new PInteger (0);
PDouble pdbMessageNum = new PDouble (0);
//initialising of RETURN parameters
PStringBuffer pstReturn = new PStringBuffer("N");
//setting the array items sizes
for (int i=0; i<pstDataSource.length; i++)
pstDataSource[i] = new PStringBuffer(60);
pstPrompt[i] = new PStringBuffer(30);
pstDataType[i] = new PStringBuffer(30);
pdbDataLength[i] = new PDouble(-1);
pdbDecimalPlaces[i] = new PDouble(-1);
pstMandatoryIND[i] = new PStringBuffer(1);
pstUCaseIND[i] = new PStringBuffer(1);
pstDisplayOnlyIND[i] = new PStringBuffer(1);
pstWebLinkCode[i] = new PStringBuffer(10);
try
strClientString = strClientString.concat ("001");
ssfk_get_metadata ssfAppMetaData = new
ssfk_get_metadata (sesSession);
strClientString = strClientString.concat ("002");
pstReturn = ssfAppMetaData.ssfp_get_2metadata
(pdbUserPersonId, pstSelfServeApplication, pstDataSource,
pstPrompt, pstDataType, pdbDataLength, pdbDecimalPlaces,
pstMandatoryIND, pstUCaseIND, pstDisplayOnlyIND, pstWebLinkCode,
pinTableIndex, pdbMessageNum);
strClientString = strClientString.concat ("003");
if
(pstReturn.stringValue().equalsIgnoreCase("Y"))
strClientString = strClientString.concat
("WORKED");
return strClientString;
else
return "ERROR";
catch (Exception e)
return strClientString + "ERROR:" + e.getMessage
Thanks for any assistance.
null

Play with Java Vectors. They are automatic expanding arrays!
Just add elements and get them later. One thing that's tricky
is that Vectors only store and return elements as Objects so you
have to explicitly recast them.
-dan
Richard Leigh (guest) wrote:
: Hi, We are returning tables of VARCHAR, NUMBERS, BOOLEANs and
: the like to Java using PL2JAVA and Oracle Sessions. Problem I
am
: having is the size of the Array's are undetermined, but it
: appears these must be set before calling package - if package
: returns more rows in tables than the calling Java arrays have,
: then it fails. If we assign too many then I guess we are
using
: memory which will be wasted - important when this system could
: have 100 simultaneous users/connections.
: Has anyone got any advice - people may find the sample code
below
: useful at worse.
: PACKAGE INTERFACE:
: FUNCTION ssfk_get_metadata.ssfp_get_2metadata RETURNS VARCHAR2
: Argument Name Type In/Out
: Default?
: P_USER_PERSON_ID NUMBER(10) IN
: P_SELF_SERVE_APPLICATION VARCHAR2 IN
: PT_DATA_SOURCE TABLE OF VARCHAR2(60) OUT
: PT_PROMPT TABLE OF VARCHAR2(30) OUT
: PT_DATA_TYPE TABLE OF VARCHAR2(30) OUT
: PT_DATA_LENGTH TABLE OF NUMBER OUT
: PT_DECIMAL_PLACES TABLE OF NUMBER OUT
: PT_MANDATORY_IND TABLE OF VARCHAR2(1) OUT
: PT_UCASE_IND TABLE OF VARCHAR2(1) OUT
: PT_DISPLAY_ONLY_IND TABLE OF VARCHAR2(1) OUT
: PT_WEB_LINK_CD TABLE OF VARCHAR2(10) OUT
: P_TABLE_INDEX BINARY_INTEGER OUT
: P_MESSAGE_NUM NUMBER(5) OUT
: Code example:
: public static String getApplicationMetaData (String
: strPersonID, String strApplication, Session sesSession)
: String strClientString = "";
: if (sesSession==null)
: return "CONNECTION ERROR";
: else
: Double dblUser = new Double(strPersonID);
: //initialising of IN parameters
: PDouble pdbUserPersonId = new PDouble
: (dblUser.intValue());
: PStringBuffer pstSelfServeApplication = new
: PStringBuffer (strApplication);
: //initialising of OUT parameters
: PStringBuffer pstDataSource[] = new PStringBuffer
: [intArraySize];
: PStringBuffer pstPrompt[] = new PStringBuffer
: [intArraySize];
: PStringBuffer pstDataType[] = new PStringBuffer
: [intArraySize];
: PDouble pdbDataLength[] = new PDouble
[intArraySize];
: PDouble pdbDecimalPlaces[] = new PDouble
: [intArraySize];
: PStringBuffer pstMandatoryIND[] = new
PStringBuffer
: [intArraySize];
: PStringBuffer pstUCaseIND[] = new PStringBuffer
: [intArraySize];
: PStringBuffer pstDisplayOnlyIND[] = new
PStringBuffer
: [intArraySize];
: PStringBuffer pstWebLinkCode[] = new PStringBuffer
: [intArraySize];
: PInteger pinTableIndex = new PInteger (0);
: PDouble pdbMessageNum = new PDouble (0);
: //initialising of RETURN parameters
: PStringBuffer pstReturn = new PStringBuffer("N");
: //setting the array items sizes
: for (int i=0; i<pstDataSource.length; i++)
: pstDataSource[i] = new PStringBuffer(60);
: pstPrompt[i] = new PStringBuffer(30);
: pstDataType[i] = new PStringBuffer(30);
: pdbDataLength[i] = new PDouble(-1);
: pdbDecimalPlaces[i] = new PDouble(-1);
: pstMandatoryIND[i] = new PStringBuffer(1);
: pstUCaseIND[i] = new PStringBuffer(1);
: pstDisplayOnlyIND[i] = new PStringBuffer(1);
: pstWebLinkCode[i] = new PStringBuffer(10);
: try
: strClientString = strClientString.concat
("001");
: ssfk_get_metadata ssfAppMetaData = new
: ssfk_get_metadata (sesSession);
: strClientString = strClientString.concat
("002");
: pstReturn = ssfAppMetaData.ssfp_get_2metadata
: (pdbUserPersonId, pstSelfServeApplication, pstDataSource,
: pstPrompt, pstDataType, pdbDataLength, pdbDecimalPlaces,
: pstMandatoryIND, pstUCaseIND, pstDisplayOnlyIND,
pstWebLinkCode,
: pinTableIndex, pdbMessageNum);
: strClientString = strClientString.concat
("003");
: if
: (pstReturn.stringValue().equalsIgnoreCase("Y"))
: strClientString = strClientString.concat
: ("WORKED");
: return strClientString;
: else
: return "ERROR";
: catch (Exception e)
: return strClientString + "ERROR:" +
e.getMessage
: Thanks for any assistance.
null

Similar Messages

  • How do I see the HTML code of my web page?

    How do I see my web page's HTML code? I want to install Google Analytics and I have to insert the tracking code into a certain part of the web page's HTML code, but iWeb doesn't show me the code to manually manipulate it.
    Is this even possible? I am looking for a view that shows me all the code and can't find it.

    You'll see the HTML after publishing the pages.
    Here's a way to add Google Analytics :
    [Adding Google Analytics without editing the webpage|http://www.wyodor.net/blog/archives/2010/05/entry_316.html]
    And if you search this forum you'll also find answers : [google analytics|http://discussions.apple.com/search.jspa?objID=c188&search=Go&q=googl e+analytics]

  • How do I see the source code in a Digital Edition doc?

    First let me say that as an author, I'm a huGe fan of DRM and anything else that protects my ability to feed my family by allowing me to control who can sell my copyrighted works.
    But.....I'm creating a book that I hope will eventually be accessed through Adobe Digital Editions and I would like to see what the books look like from the backside. Usually I go into Sigil to have a look at the coding of books whose layout I like.... but because of DRM I can't see the source code in any of the books in my Digital Library.  So, is there a way to take a peek at the coding of a Digital Library book? I don't care about the content, only how the CSS and HTML are done.
    Thanks
    RS

    You're welcome

  • How do i see the time code on my imported video

    I am trying to see the time code on the video i imported as i do editing

    You can see date and time the frame was shot by clicking VIEW/PLAYHEAD INFO and skimming over the clip.
    If your camcorder shoots professional timecode, you would need Final Cut Pro to see that.

  • Cannot read Java array in javascript. Please see my code

    Here is the script
    <webuijsf:script binding="#{temp.script2}" id="script2">
    foo()
    var picture = <%=getApplicationBean1().getPictureDirName()[1].toString()%>;
    </webuijsf:script>
    <webuijsf:body binding="#{temp.body1}" id="body1" onLoad="foo();" style="-rave-layout: grid">
    Error Message
    The content of the form must consist of well-formed character data or markup.
    Can anyone tell me what is the problem
    I would be very greatfull if anyone could help me read a java var or array in a javascript

    http://forum.java.sun.com/thread.jspa?threadID=5143339&messageID=9529903#9529903
    http://forum.java.sun.com/thread.jspa?threadID=5143428&messageID=9530475#9530475
    http://forum.java.sun.com/thread.jspa?threadID=5143443&messageID=9530587#9530587
    http://forum.java.sun.com/thread.jspa?threadID=5143467&messageID=9530764#9530764
    Why are you spamming 4 threads about the same problem? Use one thread and gently use the edit button if you want to add some new information. With 4 separate threads we are missing the overview.

  • How do I see the source code for 'NI Example Finder'?

    At the LabView Express demo, the rep showed us how to view the source code for 'NI Example Finder' (started with Help, Find Examples...). Please refresh my memory.
    --todd

    There are a couple of VI's that shipped with LabView 7.0, but you can't see the diagrams.
    C:\Program Files\National Instruments\LabVIEW 7.0\resource\system\HelpServer.llb\Run Example Finder__NATIONAL INSTRUMENTS.vi
    Press Ctrl-E on this VI and it prompts you for a password.
    This VI is run by C:\Program Files\National Instruments\LabVIEW 7.0\resource\system\HelpServer.llb\HelpServer__NAT​IONAL INSTRUMENTS.vi
    There's also C:\Program Files\National Instruments\LabVIEW 7.0\help\_exfinder.llb\Example Finder Launcher.vi.
    Tyring to open this VI starts the NI Example Finder. Note the taskbar icon which is different from the normal VI icon.
    It seems like NI is trying to keep us out, even if it used LabView to develop the Example Finder.

  • How do you see a pages code?

    Hi,
    I am on a Mac and I know if I hit Command + Option + A it will pull up an activity page which shows the content of a page.  I see .gifs and . jpgs and .css....
    I am curious if I click on the .html page is there a way to see their code?
    Thanks,
    Gary

    From any web browser, you can view HTML code with > View > Source Code or View > Page Source.
    If you have Firebug or the Web Developer Toolbar add-ons for Firefox, you can see a lot more stuff, too.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How do I see the source code of a html page?

    In previous versions it was possible to read the source code on a html page from "view" menu. It is not longer there. How do I read code now?

    You're welcome

  • [JNI Beginner] GC of Java arrays returned by the native code

    Hello all,
    I am beginning with JNI, to integrate a C library that pilots an industrial equipment, into a java UI. This library enables to exchange various proprietary PDUs (protocol data units), with the equipment, up and down (request/replies). Both requests and replies are arrays of bytes (+char*+).
    "Request" byte arrays are constructed by Java code, which passes them to the JNI code that glues with the lib. "Reply" byte arrays are returned to the Java code, which analyzes them.
    The "return reply" part is very similar to this [tutorial example|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html] , which returns bytes read from a file. However there's something I don't understand with regard to garbage collection of the returned byte array:
    - in this stock example, the C code creates a Java byte array fills it, and simply returns it (example code stripped to highlight only the parts relevant to my question):
        jByteArray=(*env)->NewByteArray(env, size);
        (*env)->SetByteArrayRegion(env, jByteArray, 0, size, (jbyte *)sourceBytes);
        return (jByteArray);What will happen to this Java array (jByteArray) with regard to garbage collection?
    - if it's no more referenced (the example Java code just systemouts it and forgets it), will it be eligible to GC?
    - if it is referenced by a Java variable (in my case, I plan to keep a reference to several replies as the business logic requires to analyze several of them together), do regular Java language GC rules apply, and prevent eligibility of the array to GC as long as it's referenced?
    That may sound obvious, but what mixes me up is that the same tutorial describes memory issues in subsequent chapters: spécifically, the section on "passing arrays states that:
    [in the example] the array is returned to the calling Java language method, which in turn, garbage collects the reference to the array when it is no longer usedThis seems to answer "yes" to both my questions above :o) But it goes on:
    The array can be explicitly freed with the following call:
    {code} (*env)-> ReleaseByteArrayElements(env, jByteArray, (jbyte *)sourceBytes, 0);{code}Under what circumstances would one need to explicitly free jByteArray when it's about to be returned to the Java calling method? Or does this sentence apply to completely different situations (such as, when the array is +not+ returned as is to a Java method)?
    The tutorial's next section has a much-expected +memory issues+ paragraph, from which I quote:
    By default, JNI uses local references when creating objects inside a native method. This means when the method returns, the references are eligible to be garbage collected.I assume this means, +unless the references are assigned, in the Java code, to a Java variable+, right?
    If you want an object to persist across native method calls, use a global reference instead. A global reference is created from a local reference by calling NewGlobalReference on the the local reference.I assume this enables the C code to maintain a global reference to a java object even if it's not referenced anymore from the Java variables, right?
    I also checked the [JNI specification|http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp1242] , but this didn't clear the doubt completely:
    *Global and Local References*
    The JNI divides object references used by the native code into two categories: local and global references. Local references are valid for the duration of a native method call, and are automatically freed after the native method returns. Global references remain valid until they are explicitly freed.
    Objects are passed to native methods as local references. All Java objects returned by JNI functions are local references. The JNI allows the programmer to create global references from local references. JNI functions that expect Java objects accept both global and local references. A native method may return a local or global reference to the VM as its resultAgain I assume the intent is that Global references are meant for objects that have to survive across native calls, regardless of whether they are referenced by Java code. But what worries me is that combining both sentences end up in +All Java objects returned by JNI functions are local references (...) and are automatically freed after the native method returns.+.
    Could you clarify how to make sure that my Java byte arrays, be they allocated in C code, behave consistently with a Java array allocated in Java code (I'm familiar already with GC of "regular" Java objects)?
    Thanks in advance, and best regards,
    J.

    jduprez wrote:
    Hello all,
    I am beginning with JNI, to integrate a C library that pilots an industrial equipment, into a java UI. This library enables to exchange various proprietary PDUs (protocol data units), with the equipment, up and down (request/replies). Both requests and replies are arrays of bytes (+char*+).
    "Request" byte arrays are constructed by Java code, which passes them to the JNI code that glues with the lib. "Reply" byte arrays are returned to the Java code, which analyzes them.
    The "return reply" part is very similar to this [tutorial example|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html] , which returns bytes read from a file. However there's something I don't understand with regard to garbage collection of the returned byte array:
    - in this stock example, the C code creates a Java byte array fills it, and simply returns it (example code stripped to highlight only the parts relevant to my question):
        jByteArray=(*env)->NewByteArray(env, size);
    (*env)->SetByteArrayRegion(env, jByteArray, 0, size, (jbyte *)sourceBytes);
    return (jByteArray);What will happen to this Java array (jByteArray) with regard to garbage collection?It will be collected when it is no longer referenced.
    The fact that you created it in jni doesn't change that.
    The array can be explicitly freed with the following call:
    (*env)-> ReleaseByteArrayElements(env, jByteArray, (jbyte *)sourceBytes, 0);Under what circumstances would one need to explicitly free jByteArray when it's about to be returned to the Java calling method? Or does this sentence apply to completely different situations (such as, when the array is not returned as is to a Java method)?
    Per what the tutorial says it is either poorly worded or just wrong.
    An array which has been properly initialized it a just a java object. Thus it can be freed like any other object.
    Per your original question that does not concern you because you return it.
    In terms of why you need to explicitly free local references.
    [http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp16785]
    The tutorial's next section has a much-expected memory issues paragraph, from which I quote:
    By default, JNI uses local references when creating objects inside a native method. This means when the method returns, the references are eligible to be garbage collected.I assume this means, unless the references are assigned, in the Java code, to a Java variable, right?As stated it is not precise.
    The created objects are tracked by the VM. When they are eligible to be collected they are.
    If you create a local reference and do NOTHING that creates an active reference elsewhere then when the executing thread returns to the VM then the local references are eligible to be collected.
    >
    If you want an object to persist across native method calls, use a global reference instead. A global reference is created from a local reference by calling NewGlobalReference on the the local reference.That is not precise. The scope is the executing thread. You can pass a local reference to another method without problem.
    I assume this enables the C code to maintain a global reference to a java object even if it's not referenced anymore from the Java variables, right?
    It enables access to it to be insured across multiple threads in terms of execution scope. Normally you should not use them.

  • How can i see the code of SAP Exit for SAP Defined Variables

    Hi,
       It's very Urgent! How can i see the Source Code of SAP Provided Variables. I need to write code for User Defined Variables. please help me. It's very Urgent.
    Thanks in Advance.
    Nagesh.

    hi Nagesh,
    sample code for variable exit,
    there is 'how to' docs, can't see your email address.
      DATA: L_S_RANGE TYPE RSR_S_RANGESID.
      DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
      CASE I_VNAM.
      WHEN 'CUMMONTH'.
        IF I_STEP = 2.                                  "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'MONTH'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
            L_S_RANGE-LOW+4(2) = '01'.
            L_S_RANGE-HIGH     = LOC_VAR_RANGE-LOW.   "high value = input
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
      ENDCASE.

  • How to see user exit code

    hi,
    i have one user exit name with me like EXIT_SAPLVxxxxx. how can i see it's code.
    thks

    Those user exits are build as function modules. Just goe to transaction SE37, put in the name and there you go. Double click on the include in the FM and you'll see the code. If the include doesn't exist this user exit has not yet been implemented.
    Regards,
    Michael

  • Java.lang.OutOfMemoryError: Requested array size exceeds VM limit

    Hi!
    I've a this problem and I do not know how to reselve it:
    I' ve an oracle 11gr2 database in which I installed the Italian network
    when I try to execute a Shortest Path algorithm or a shortestPathAStar algorithm in a java program I got this error.
    [ConfigManager::loadConfig, INFO] Load config from specified inputstream.
    [oracle.spatial.network.NetworkMetadataImpl, DEBUG] History metadata not found for ROUTING.ITALIA_SPAZIO
    [LODNetworkAdaptorSDO::readMaximumLinkLevel, DEBUG] Query String: SELECT MAX(LINK_LEVEL) FROM ROUTING.ITALIA_SPAZIO_LINK$ WHERE LINK_LEVEL > -1
    *****Begin: Shortest Path with Multiple Link Levels
    *****Shortest Path Using Dijkstra
    [oracle.spatial.network.lod.LabelSettingAlgorithm, DEBUG] User data categories:
    [LODNetworkAdaptorSDO::isNetworkPartitioned, DEBUG] Query String: SELECT p.PARTITION_ID FROM ROUTING.ITA_SPAZIO_P_TABLE p WHERE p.LINK_LEVEL = ? AND ROWNUM = 1 [1]
    [QueryUtility::prepareIDListStatement, DEBUG] Query String: SELECT NODE_ID, PARTITION_ID FROM ROUTING.ITA_SPAZIO_P_TABLE p WHERE p.NODE_ID IN ( SELECT column_value FROM table(:varray) ) AND LINK_LEVEL = ?
    [oracle.spatial.network.lod.util.QueryUtility, FINEST] ID Array: [2195814]
    [LODNetworkAdaptorSDO::readNodePartitionIds, DEBUG] Query linkLevel = 1
    [NetworkIOImpl::readLogicalPartition, DEBUG] Read partition from blob table: partition 1181, level 1
    [LODNetworkAdaptorSDO::readPartitionBlobEntry, DEBUG] Query String: SELECT BLOB, NUM_INODES, NUM_ENODES, NUM_ILINKS, NUM_ELINKS, NUM_INLINKS, NUM_OUTLINKS, USER_DATA_INCLUDED FROM ROUTING.ITA_SPAZIO_P_BLOBS_TABLE WHERE PARTITION_ID = ? AND LINK_LEVEL = ? [1181,1]
    [oracle.spatial.network.lod.LabelSettingAlgorithm, WARN] Requested array size exceeds VM limit
    [NetworkIOImpl::readLogicalPartition, DEBUG] Read partition from blob table: partition 1181, level 1
    [LODNetworkAdaptorSDO::readPartitionBlobEntry, DEBUG] Query String: SELECT BLOB, NUM_INODES, NUM_ENODES, NUM_ILINKS, NUM_ELINKS, NUM_INLINKS, NUM_OUTLINKS, USER_DATA_INCLUDED FROM ROUTING.ITA_SPAZIO_P_BLOBS_TABLE WHERE PARTITION_ID = ? AND LINK_LEVEL = ? [1181,1]
    Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
    I use the sdoapi.jar, sdomn.jar and sdoutl.jar stored in the jlib directory of the oracle installation path.
    When I performe this query : SELECT BLOB, NUM_INODES, NUM_ENODES, NUM_ILINKS, NUM_ELINKS, NUM_INLINKS, NUM_OUTLINKS, USER_DATA_INCLUDED FROM ROUTING.ITA_SPAZIO_P_BLOBS_TABLE WHERE PARTITION_ID = ? AND LINK_LEVEL = ? [1181,1]
    I got the following result
    BLOB NUM_INODES NUM_ENODES NUM_ILINKS NUM_ELINKS NUM_INLINKS NUM_OUTLINKS USER_DATA_INCLUDED
    (BLOB) 3408 116 3733 136 130 128 N
    then the java code I use is :
    package it.sistematica.oracle.spatial;
    import it.sistematica.oracle.network.data.Constant;
    import java.io.InputStream;
    import java.sql.Connection;
    import oracle.spatial.network.lod.DynamicLinkLevelSelector;
    import oracle.spatial.network.lod.GeodeticCostFunction;
    import oracle.spatial.network.lod.HeuristicCostFunction;
    import oracle.spatial.network.lod.LODNetworkManager;
    import oracle.spatial.network.lod.LinkLevelSelector;
    import oracle.spatial.network.lod.LogicalSubPath;
    import oracle.spatial.network.lod.NetworkAnalyst;
    import oracle.spatial.network.lod.NetworkIO;
    import oracle.spatial.network.lod.PointOnNet;
    import oracle.spatial.network.lod.config.LODConfig;
    import oracle.spatial.network.lod.util.PrintUtility;
    import oracle.spatial.util.Logger;
    public class SpWithMultiLinkLevel
         private static NetworkAnalyst analyst;
         private static NetworkIO networkIO;
         private static void setLogLevel(String logLevel)
         if("FATAL".equalsIgnoreCase(logLevel))
         Logger.setGlobalLevel(Logger.LEVEL_FATAL);
         else if("ERROR".equalsIgnoreCase(logLevel))
         Logger.setGlobalLevel(Logger.LEVEL_ERROR);
         else if("WARN".equalsIgnoreCase(logLevel))
         Logger.setGlobalLevel(Logger.LEVEL_WARN);
         else if("INFO".equalsIgnoreCase(logLevel))
         Logger.setGlobalLevel(Logger.LEVEL_INFO);
         else if("DEBUG".equalsIgnoreCase(logLevel))
         Logger.setGlobalLevel(Logger.LEVEL_DEBUG);
         else if("FINEST".equalsIgnoreCase(logLevel))
         Logger.setGlobalLevel(Logger.LEVEL_FINEST);
         else //default: set to ERROR
         Logger.setGlobalLevel(Logger.LEVEL_ERROR);
         public static void main(String[] args) throws Exception
              String configXmlFile =                "LODConfigs.xml";
              String logLevel =           "FINEST";
              String dbUrl =                Constant.PARAM_DB_URL;
              String dbUser =                Constant.PARAM_DB_USER;
              String dbPassword =                Constant.PARAM_DB_PASS;
              String networkName =                Constant.PARAM_NETWORK_NAME;
              long startNodeId = 2195814;
              long endNodeId = 3415235;
         int linkLevel = 1;
         double costThreshold = 1550;
         int numHighLevelNeighbors = 8;
         double costMultiplier = 1.5;
         Connection conn = null;
         //get input parameters
         for(int i=0; i<args.length; i++)
         if(args.equalsIgnoreCase("-dbUrl"))
         dbUrl = args[i+1];
         else if(args[i].equalsIgnoreCase("-dbUser"))
         dbUser = args[i+1];
         else if(args[i].equalsIgnoreCase("-dbPassword"))
         dbPassword = args[i+1];
         else if(args[i].equalsIgnoreCase("-networkName") && args[i+1]!=null)
         networkName = args[i+1].toUpperCase();
         else if(args[i].equalsIgnoreCase("-linkLevel"))
         linkLevel = Integer.parseInt(args[i+1]);
         else if(args[i].equalsIgnoreCase("-configXmlFile"))
         configXmlFile = args[i+1];
         else if(args[i].equalsIgnoreCase("-logLevel"))
         logLevel = args[i+1];
         // opening connection
         System.out.println("Connecting to ......... " + Constant.PARAM_DB_URL);
         conn = LODNetworkManager.getConnection(dbUrl, dbUser, dbPassword);
         System.out.println("Network analysis for "+networkName);
         setLogLevel(logLevel);
         //load user specified LOD configuration (optional),
         //otherwise default configuration will be used
         InputStream config = (new Network()).readConfig(configXmlFile);
         LODNetworkManager.getConfigManager().loadConfig(config);
         LODConfig c = LODNetworkManager.getConfigManager().getConfig(networkName);
         //get network input/output object
         networkIO = LODNetworkManager.getCachedNetworkIO(
         conn, networkName, networkName, null);
         //get network analyst
         analyst = LODNetworkManager.getNetworkAnalyst(networkIO);
         double[] costThresholds = {costThreshold};
         LogicalSubPath subPath = null;
         try
              System.out.println("*****Begin: Shortest Path with Multiple Link Levels");
              System.out.println("*****Shortest Path Using Dijkstra");
              String algorithm = "DIJKSTRA";
              linkLevel = 1;
              costThreshold = 5000;
              subPath = analyst.shortestPathDijkstra(new PointOnNet(startNodeId), new PointOnNet(endNodeId),linkLevel, null);
              PrintUtility.print(System.out, subPath, true, 10000, 0);
              System.out.println("*****End: Shortest path using Dijkstra");
              catch (Exception e)
              e.printStackTrace();
              try
              System.out.println("*****Shortest Path using Astar");
              HeuristicCostFunction costFunction = new GeodeticCostFunction(0,-1, 0, -2);
              LinkLevelSelector lls = new DynamicLinkLevelSelector(analyst, linkLevel, costFunction, costThresholds, numHighLevelNeighbors, costMultiplier, null);
              subPath = analyst.shortestPathAStar(
              new PointOnNet(startNodeId), new PointOnNet(endNodeId), null, costFunction, lls);
              PrintUtility.print(System.out, subPath, true, 10000, 0);
              System.out.println("*****End: Shortest Path Using Astar");
              System.out.println("*****End: Shortest Path with Multiple Link Levels");
              catch (Exception e)
              e.printStackTrace();
         if(conn!=null)
         try{conn.close();} catch(Exception ignore){}
    At first I create a two link level network with this command
    exec sdo_net.spatial_partition('ITALIA_SPAZIO', 'ITA_SPAZIO_P_TABLE', 5000, 'LOAD_DIR', 'sdlod_part.log', 'w', 1);
    exec sdo_net.spatial_partition('ITALIA_SPAZIO', 'ITA_SPAZIO_P_TABLE', 60000, 'LOAD_DIR', 'sdlod_part.log', 'w', 2);
    exec sdo_net.generate_partition_blobs('ITALIA_SPAZIO', 1, 'ITA_SPAZIO_P_BLOBS_TABLE', true, true, 'LOAD_DIR', 'sdlod_part_blob.log', 'w', false, true);
    exec sdo_net.generate_partition_blobs('ITALIA_SPAZIO', 2, 'ITA_SPAZIO_P_BLOBS_TABLE', true, true, 'LOAD_DIR', 'sdlod_part_blob.log', 'w', false, true);
    Then I try with a single level network but I got the same error.
    Please can samebody help me?

    I find the solution to this problem.
    In the LODConfig.xml file I have:
    <readPartitionFromBlob>true</readPartitionFromBlob>
                   <partitionBlobTranslator>oracle.spatial.network.lod.PartitionBlobTranslator11g</partitionBlobTranslator>
    but when I change it to
    <readPartitionFromBlob>true</readPartitionFromBlob>
                   <partitionBlobTranslator>oracle.spatial.network.lod.PartitionBlobTranslator11gR2</partitionBlobTranslator>
    The application starts without the obove mentioned error.

  • How do we monitor Java heap size

    How do we monitor Java heap size? Is there any way to check whether we are exceeding the heap size or not?
    Regards,
    N.S

    Hi,
    > How do we monitor Java heap size? Is there any way to
    > check whether we are exceeding the heap size or not?
    >
    You should run your JAVA AS with the recommended settings described in the note
    "Java VM settings for J2EE 6.30/6.40/7.0"
    SAP Note Number: 723909.
    If you do so, you can find the garbage collector log messages in your dev_server* or your std_server*.out file.
    You can also use the option -Xloggc:<file> to log to a seperate file.
    You can visualize the GC log file with a tool like GCViewer.
    See
    http://www.javaperformancetuning.com/tools/gcviewer/index.shtml
    for an overview of this tool.
    Regards,
    Markus

  • How to change array size in forms6i

    Does anyone know how to change the array size in Forms6i.
    The only runtime option i see is Array=YES (Use array SQL processing). But I want to increase the number of records per request retrieved. There's supposed to be a 'Query Array Size' parameter but I have no clue where to find this ...
    kind regards

    Kurt, it may sound an obvious point to make but - did you even consider the on the help??
    We spend a lot of effort in producing this and it should be the first stop for quesions.
    Bring up the help, click on index and then type in "QUERY ARRAY" - and the list automatically moved to the topic you want.
    Regards
    Grant Ronald
    Forms Product Management

  • How do you see the size of your hard drive

    I am new the the MAC world and I am trying to figure out some things.  How do you see the size remaining on your hardrive?

    If you have a folder open or dubble click on your hard drive you, can turn on the status bar which will show you available disc space:

Maybe you are looking for

  • PLz Help New To Java

    Hey im brand new to java and i just downloaded and installed jdk-1_5_0_01-windows-i586-p now im tryin to set up the PATH permanently but i have no clue how to i went to the install notes and typed in C:\Program Files\Java\jdk1.5.0_<windows>\bin in th

  • Getting problem while MDM ResultSet iView

    Hi all, I am creating SAP MDM ResultSet iView. In Step 4: Search Table, I am not getting the Search table as pop-up even if the Test Connection with System Object of SAP MDM System object is successfull. All steps like creating System Object, System

  • 503   Service Unavailable - Dispatcher running but no server connected!

    Hi Everybody. I've apllied the SP 11 into the Enterprise Porta 7.0, in HPUX IA64, and follow message appear when I call the portal page:   SAP WebAS Engine is starting or started but not yet operational! If this state does not change within a few min

  • How to run exe in servlet?

    I need to run a local exe program and here is the code in servlet. private static Exception error = null;            public static boolean runBatch() {                 boolean result = false;                 try {                      Runtime r = Run

  • What defrag program should I use

    What is the best free defrag program I can use