Arrays and vectors

Hi
I'm having a bit of difficulty with the following method
I have a vector - numbera that is full of integers,
What I want to do is copy these into in an array but I seem to be having a spot of bother getting this to work !!!
When I try to print the contents of indexa I just get a null reference returned
Can anyone help me out !!!
public int[] indexa()
    int indexa[] = new int[numbera.size()];
    Iterator p = numbera.iterator();
    for (int i = 0; i < numbera.size(); i++)
      indexa[i] = Integer.parseInt(p.next().toString());
       return indexa;
[\code]

First,
Did you fill the vector? What did you fill the vector with? Vectors cannot hold primitive data types (such as int). It always holds Objects, such as Integer. If you did all that already, there sould be stuff in the Vector, and it should not be null.
Second,
I don't like vectors, so I never use them. But when I do, I was taught to use Enumerations, not Iterators. Like so:
Enumeration e = numbera.elements();
int i = 0;
while(e.hasMoreElements()){
   Integer elem = (Integer)e.nextElement(); //here i am assuming you put in an Integer
   indexa[i] = Integer.intValue(elem);
   i++;
}I don't know how to use Iterators with vectors, since I've never done it that way. Maybe my solution is not what you are looking for, but I think it should work (provided I have made no typos).
:) JenMc

Similar Messages

  • Size restrictions on arrays and vectors

    Hi all!!!
    I want to know whether there is any restriction on maximum size of array and vectors.
    If I have thousands of records to be displayed on browser through JSP, can I initialise the arrays/vectors with that no.
    Whether it will have adverse effect on performance.
    Thanks in anticipation

    Array lists (and vectors) use an array as backing data store. And since array indices are ints, the maximum number of elements in an array list is Integer.MAX_VALUE (2 ^ 31 - 1).
    About the performance: if you know how many elements you are going to add (albeit not precisely), you can create the array list with an initial capacity. This will improve performance because a new array is created when an element is to be added but the capacity has been reached.
    Kind regards,
      Levi

  • How can i create a Matrix and vector in LV7.0?

    thanks a lot!

    By Matrix do you mean an m x n array, and vector a 1 x n array? If so, use Initialize Array.vi. There are lots of array manipulation vi's in the array function pallette.
    Tim

  • Please help, 2D Array of Vectors and Incompatible types :(

    I have a 2D array of vectors called nodeLocations but when I try and access the vector inside I get a compile error.
    My code is something like this:
    nodeLocations[j].addElement(noArc)
    My editor picks up that its a Vector and shows me addElement as an acceptable entry to put after the "." yet the compiler says:
    "addElement(java.lang.Object) in java.util.Vector cannot be applied to (int)"
    Can someone please help?
    Thank you in advance.
    also a related problem:
    I get inconvertible types (says int required) when I try and get an element from a vector stored in a 2D Array. I know that it comes out as an object and so should be cast but it does not seem to work. My code is as follows:
    else if (((int)(nodeLocations[nodeNumber][adjNodeNumber].elementAt(0))) != distance)
    I would appreciate any help anyone can give.
    Similar errors to the above two happen when
    I try a push with a Stack in a vector.
    I try to get something out of the stack inside the vector.

    The Vector class's addElement() method requires an Object parameter. It appears that you're trying to add an int to the Vector. You'll need to create an Integer object and place that into the vector (see sample below) or use the pre-release version of JDK 1.5 which provides autoboxing capabilities.
    int z = 5;
    Integer x = new Integer(z);
    nodeLocations[j].addElement(x);

  • Is there any way of  using arrays or vectors in JavaScript

    In my JSP page when ever a value in the text field changes i have to store that value before submitting a form. When ever the value in the text field changes i have to use "OnChange" option but i have to store all these values in an array or vector. Is there any other way of doing this. I am using webwork. Can any one help me!!!!!!

    JavaScript arrays are dynamic. You can add new values to the array and the array will grow in size.
    //a is an array of size zero
    var a = new Array();
    a[0] = "something";
    a[1] = "else";
    a[a.length] = "Adding another String at the end of my array";But here's something to think about. If your web site absolutely needs JavaScript, what happens to your site when the user decides to disable JavaScript in his browser....?
    I only use JavaScript to validate the user's input data, but I revalidate server-side in case JavaScript was disabled.

  • How to save data in a 4D array and make partial plots in real time?

    Hi, this is a little complex, so bear with me...
    I have a test system that tests a number of parts at the same time. The
    experiment I do consists of measuring a number of properties of the
    parts at various temperatures and voltages. I want to save all the
    measured data in a 4-dimensional array. The indices represent,
    respectively, temperature, voltage, part, property.
    The way the experiment is done, I first do a loop in temperature, then
    in voltage, then switch the part. At this point, I measure all the
    properties for that condition and part and want to add them as a 1D
    array to the 4D array.
    At the same time, I want to make a multiple plot (on an XY graph) of
    one selected property and part (using two pull-down selectors near the
    XY graph) vs. voltage. (The reason I need to use an XY graph and not a
    waveform graph, which would be easier, is that I do not have
    equidistant steps in voltage, although all the voltage values I step
    through are the same for all cases). The multiple plots are the data
    sets at different temperatures. I would like to draw connection lines
    between the points as a guide to the eye.
    I also want the plot to be updated in the innermost for loop in real
    time as the data are measured. I have a VI working using nested loops
    as described above and passing the 4D array through shift registers,
    starting with an array of the right dimensions initialized by zeroes. I
    know in advance how many times all the loops have to be executed, and I
    use the ReplaceArraySubset function to add the measured properties each
    time. I then use IndexArray with the part and property index terminals
    wired to extract the 2D array containing the data I want to plot. After
    some transformation to combine these data with an array of the voltage
    values in the form required to pass to the XYGraph control, I get my
    plot.
    The problem is: During program execution, when only partial data is
    available, all the zero elements in the array do not allow the graph to
    autoscale properly, and the lines between the points make little sense
    when they jump to zero.
    Here is how I think the problem could be solved:
    1. Start with an empty array and have the array grow gradually as the
    elements are measured. I tried to implement this using Insert Into
    Array. Unfortunately, this VI is not as flexible as the Replace Array
    Subset, and does not allow me to add a 1D array to a 4D array. One
    other option would be to use the Build Array, but I could not figure
    out if this is usable in this case.
    2. The second option would be to extract only the already measured data
    points from the 4D array and pass them to the graph
    3. Keep track of the min. and max. values (only when they are different
    from zero) and manually reset the graph Y axis scale each time.
    Option 3 is doable, but more work for me.....
    Option 2: I first tried to use Array Subset, but this always returns an
    array of the same dimensionality of the input array. It seems to be
    very difficult, but maybe not impossible, to make this work by using
    Index Array first followed by Array Subset. Option 3 seems easier.
    Ideally, I would like option 1, but I cannot figure out how to achieve
    this.
    Your help is appreciated, thanks in advance!
    germ Remove "nospam" to reply

    In article <[email protected]>,
    chutla wrote:
    > Greetings!
    >
    > You can use any of the 3D display vi's to show your "main" 3d
    > data, and then use color to represent your fourth dimension. This can
    > be accessed via the property node. You will have to set thresholds
    > for each color you use, which is quite simple using the comparison
    > functions. As far as the data is concerned, the fourth dimension will
    > be just another vector (column) in your data file.
    chutla, thanks for your post, but I don't want a 3D display of the
    data....
    > Also, check out
    > the BUFFER examples for how to separate out "running" data in real
    > time.
    Not clear to me what you mean, but will c
    heck the BUFFER examples.
    > As far as autoscaling is concerned, you might have to disable
    > it, or alternatively, you could force a couple of "dummy" points into
    > your data which represent the absolute min/max you should encounter.
    > Autoscaling should generally be regarded as a default mode, just to
    > get things rolling, it should not be relied on too heavily for serious
    > data acquisition. It's better to use well-conditioned data, or some
    > other means, such as a logarithmic scale, to allow access to all your
    > possible data points.
    I love autoscaling, that's the way it should be.
    germ Remove "nospam" to reply

  • Array to vector - isn't working.

    Hello all.
    Firstly, this is not a homework question. I am doing a course which teaches Object Oriented programming which happens to use Java to teach it. I've discovered I like programming in Java and figure I have just enough knowledge to be dangerous, so I have set out on a project of my own.
    The app I am building uses a webservice to log into a site and retrieve sports information, then performs calculations based on the information and sends further requests to get stuff done. Your basic webservice app I guess.
    The problem I am having at the moment is that I'm trying to populate a vector using a complex type array called EventType which is returned by the service.
    I'm not having any problems getting the information back from the service, but I want to use the data returned in a JTable, which means I have to construct a model for the table and it is here that I am striking my problem.
    I can access the EventType array and get the information from it easily enough and I can separate the information I want out of it pretty easily as well. What I am having trouble doing is putting the information into a collection of some sort which I can send to my AbstractTableModel.
    The EventType array contains four arrays of Strings and Integers. I only need to work with two of them though, so my first thought was to use a HashMap<Integer, String> because the integer will always be unique to that event and can be used as a key. Another way of doing it would be to pass the information over to the table model as a vector, then break it down in the model itself.
    I am having trouble iterating over the EventType array and inserting it into whatever collection type I am using though.
    Here is the code:
    // imports
    import com.betfair.publicapi.types.global.v3.EventType;
    import java.util.Vector;
    // declarations
    public static EventType[] sports;
    public static Vector sportsVector;
    // troublesome code
    sports = new EventType[result.getEventTypeItems().getEventType().size()];
    System.out.println("Number of sports: " + sports.length);
    sportsVector = new Vector();
    System.out.println("Made the vector...");
    for (int s = 0; s < sports.length; s++)
        System.out.println("Putting entry number " + s + " in now.");
        sportsVector.addElement(sports[s]);
        System.out.println("Added sport number " + s);
    System.out.println("Filled the map...");As you can see I have sprinkled the code with println's to track down where the problem is. The code works perfectly right up until I see:
    System.out.println("Putting entry number " + s + " in now."); the first time it goes through the loop.
    Whereupon the entire thing stops. There is no crash, there is no warning in the output window (I am using netbeans), nothing happens at all. The same thing happens when I try to use a Vector or a Set. I haven't tried a list yet.
    I'm fairly sure this is something basic I have missed, but I can't for the life of me figure out what it is.
    Any ideas please?
    Alan

    Thanks for your replies guys.
    I'm not sure what has happened there, since I didn't change anything except to restart netbeans (started to behave strangely), but suddenly it is filling the vector the way it is supposed to.
    I am getting a warning:
    Note: C:\Users\alan\Documents\NetBeansProjects\AnotherBF\src\anotherbf\SportsMonitor.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.Which I think has to do with declaring a type within the vector. I gave google a scouring and after trying the solution of declaring the type within the addElement method, the whole thing refused to compile.
    i.e.
    sportsVector.addElement(new EventType(sports[s]));I'm not sure how to fix that.
    Edited by: inksmithy on 23-Mar-2008 14:09 - saying thanks to people replying.

  • How to create an array of Vectors ?

    Can I create an array of vectors in Java ? For instance I want to have an array of days in a year, an on each day there are several things to do, and I don't know this up front, so I want it to be a Vector holding the things_to_do object, some days might have nothing to do, so there should be null or an empty vector for that day. So I came up with something like the following :
    Vector<Things>[] Days_Array=new Vector<Things>[365];
    But Java doesn't allow this ?
    Frank

    Opps , I forgot to ask, although it compiled successfully, but it gave me a warning : [unchecked] unchecked conversion
    I wonder if there is a way to fix it without turning the warning off, what I meant is : Am I missing something that caused the warning that I should add to the code, I don't want to turn off the warning. For instance how can I make the "conversion" checked ?
    Frank

  • Error while using Enumeration and Vectors

    Hi all,
    I am new bee in java i am using enumeration and vectors in my JSP page,
    i want to get the values from JSP page using enumeration and store then in Vector, below is the code, its giving errors saying ArrayIndexoutofException
    pls help, thanx in advance.
              while ( enum.hasMoreElements() )
              String enumString = (String)enum.nextElement();
              String[] enumValue =request.getParameterValues(enumString);
              for(int n=0;n<=enumValue.length;n++)
              tempbean.dbRows.add(enumValue[n]);     //tempbean.dbRows is a vector,
    if I seperate the For block out of While loop then im getting cannot resolve enum variable, bcoz its declared in while loop, I cannot declare it out side of while loop because I dont know the perfect size of the array and it will change dynamically.
    pls help

    Thankyou ,
    It worked out,
    Thank you very much.

  • Array or vector

    to store a list of alphanumeric strings, what would be the best way to store these, in an array or vector?
    could anyone help plz.
    thnks, lew

    You're welcome.
    If you declare your list this way:
    List myList = new ArrayList();Then you can change your mind and synchronize it later just by changing the right side to:
    List myList = Collections.synchronizedList(new ArrayList());If everything just expects a List, not necessarily an ArrayList, then you can change the type of List without ruining the rest of the code.

  • An array of vectors that contain a user defined class gives: warning: [unch

    I've read two tutorial on Generics and still don't get everything.
    Anyway I have a user defined class called a Part. I have some Vectors of Part objects, and these Vectors of Part objects are stored in an Array of Vectors.
    Amazingly, I got all the checking right so far; however, am now trying to loop through my Array, an pass the individual Vectors to a method:
    //create a single list of all parts numbers
    //add the part number from each vector/part into a new vector of strings
    for(int y=0; y < ArrayOfPartVectors.length; y++) {
        Vector<Part> vTemp = ArrayOfPartVectors[y];
        vAllPartNumbers.addAll(pm.getPartNumbersFromVector(vTemp));
    }I get the following warning:
    com\gdls\partMatrix\PartMatrix.java:75: warning: [unchecked] unchecked conversion
    found   : java.util.Vector
    required: java.util.Vector<com.gdls.partMatrix.Part>
                                    Vector<Part> vTemp = VectorArrayParts[y];
                                                                         ^
    1 warningNow I have put the 'check' (<Part>) in every concievable spot in that statement, and I get a compler error now instead of a warning.
    Any guidance would be appreciated.
    Thank you,

    The problem is not with Vector. If you want to use it that's fine.
    You could also want to use ArrayList because the class is roughly equivalent to Vector, except that it is unsynchronized.
    But your problem is that arrays and generics don't mix well as previously mentioned in the first reply.
    You did not specify the type of ArrayOfPartVectors but I guess it is Vector[], not Vector<Part>[], right?
    So you'll have an unchecked warning when doing the conversion from Vector to Vector<Part> in the assignment within the loop.
    Maybe you tried to use a ArrayOfPartVectors of type Vector<Part>[] instead but found it impossible to create it with new
    You can do it with Array.newinstance() but you'll get an unchecked warning at this line instead of later.
    So mixing generics and arrays will allways result in warnings.
    You should read: [url http://www.angelikalanger.com/Articles/Papers/JavaGenerics/ArraysInJavaGenerics.htm]Arrays in Java Generics.
    Regards

  • Use array or vector ?

    I need to store data into a 3D array i.e. abc[128][128][128]. Every item of the array is an object.
    My problem is, if i use 3D array to store the data directly, it is too memory costing and always return OutOfMemoryError!!! Also terribly slow !
    Is it better to use vector of vector instead of 3D array? I mean put the 128 objects into a single array and then put 128 single arrays into a vector, lastly put 128 vectors into a new vector.
    Or otherwise, who has any other good suggestions to store these 128*128*128 objects?

    However, that's small compared to the number ofdistinct objects in that space -- 128^3. So the number
    of objects taken up by the arrays or vectors, is less
    than 1% of the number of objects in the 3D space
    defined by the arrays or vectors.
    Sorry, I don't get what you mean ;)
    Yes, it is 1% of the number of objects in the 3D
    space, but you haven't calculate the 4 bytes int value
    used by the int value itself.We're not talking about ints though, are we? The question was about a 3D space of objects.
    So, if let say array Object definition uses 2 bytes,
    then the RAM needed will be:
    Object definition + int values
    ((128^2 + 128 + 1) * 2) + ((128^3) * 4)
    if you create int[128^3], you will only create:
    128^3 * 4Given that problem statement, the array object definitions take up 33026 bytes, whereas the int values take up 8388608. So the memory used by the array object definitions is still just 1% of the memory used. By switching to a 1D array of length 128^3, you're saving less than 1% of the memory. The 33026 bytes isn't the problem here.
    (((128^2 + 128 + 1) * 2) + ((128^3) * 4)) is a much bigger number than ((128^2 + 128 + 1) * 2).
    Just (128^3 * 4) is a much bigger number than ((128^2 + 128 + 1) * 2).
    But anyway that's not the problem statement anyway. There are 128^3 potential objects created in the heap. That's going to be a lot more than the arrays or vectors used to reference them.
    This is why I think the best solution is to look at the data and see if a better approach can be taken than just using 128^3 buckets.
    Another slow but possible solution is using HashMap.
    To check coordinate 33, 75, 109, you can use:
    map.get(new Integer(33*75*109)] and hope Java garbage
    collector runs pretty fast.I wouldn't advise that, because that would cause conflicts between objects at 33,75,109 and 75,33,109, etc. There would be 3! = 6 possible conflicts. If you want to turn the 3D index into a flat 1D index, then multiply each coordinate by a constant to put each into its own range, e.g., (33,75,109)'s 1D index would be (33 * (128^2)) + (75 * 128) + 109.
    Hopefully that's less than the maximum int value. It may not be.
    This solution works fine only if in vast 128*128*128,
    only few hundreds coordinate x,y,z which actually have
    a value. This way you can store the value only if
    needed.Yes, exactly, if the domain data is sparse, a different approach like this would work better than defining 128^3 data buckets.
    If the data is sparse enough, it might be easier to define a 3DCoordinate object to use as the index into the hashtable, than programmatically creating a 1D index.

  • Array in vector

    Hi
    I want to store an reusable array into vector, and access the array at a particular index of vector
    Vector v1 = new Vector();
    byte array[] = new byte[3];
    Array
    array[0] =1;
    array[1] =1;
    v1.addElement(Array);
    array[0] =3;
    array1] =3;
    v1.addElement(plArray);
    array = (byte[]) v1.elementAt(0);
    array = (byte[]) v1.elementAt(1);
    currently if i were to run this program, i will get 3,3,3 for both the v1.elementAt(0) and v1.elementAt(1), how sld i amend these codes so that I will get the correct results?
    Thanks

    Use a for loop that creates a new array each time:
    for(int i = 0;i<num_arrays;i++) {
        int[] a = new int[desired_length];
        //set the values of a here
        vector.add(a);
    }

  • I hate arrays, and they hate me! -delete

    i am trying to make a method that deletes a given int from an array, if that int is present in the array. If it is not, it throws an exception. If there are multiple entries of the value to be deleted, only one of them is deleted, not all.
    unfortunately, the method must contain a loop and be an array, not a vector =(.
    what i have so far, which doesnt work heh.
    public void remove(int lessNum)throws NotFoundException {
       for( int i=0;i<this.contents.length;i++) {
         if(contents[i] == lessNum)
             occupied[i] = false ;
       }//end for
       throw new NotFoundException();
    }//end removethere is another method that inputs numbers into an array, this one deletes those numbers, if they are present. such as array named b, invoked by b.remove(int) .
    thanks for the advice.
    JG

    public void remove(int lessNum)throws
    NotFoundException {
    for( int i=0;i<this.contents.length;i++) {
         if(contents[i] == lessNum)
             occupied[i] = false ;
    }//end for
    throw new NotFoundException();
    }//end removeThats going to throw NotFoundException every time it's ran, you need
        boolean found = false;
        for( int i=0;i<this.contents.length;i++) {
         if(contents[i] == lessNum) {
             occupied[i] = false ;
                found = true;
        }//end for
        if(!found)
           throw new NotFoundException();But no, there is no "remove", you only other options are to look at "Array", and "Arrays" or not use an array.

  • Oracle Arrays and getVendorConnection API and Class Cast Exception

    I 've gone through various threads relating to the topic of Oracle Arrays and the getVendorConnecton API call to avoid the class Cast Exception.. i ve used all these but am still facing the problem...
    I would appreciate it if some one could resolve the following queries :
    I am using Weblogic 8.1 SP5 with oracle 8i
    1. I read that the need to use the getVendorConnection API to make pl/sql proc calls with oracle arrays from the WL Server wont be required to avoid classCastException...
    I tried to use the connection from the WL connection pool ..but it didnot work....I used the getVendorConnection API ..which also doesnot seem to work..
    I got the Heurisitc Hazard exception...I used the Oracle 9i driver ie ojdbc14.jar ...after this the exception is not coming but still the code doesnt seem to work...
    the snippet of the code is pasted below :
    ~~~~~~~~~~~~~~~~~~~~~~~code is : ~~~~~~~~~~~~~~~~~~~
    /*below :
    logicalCon is the Connection from the WL connection pool
    JDBCcon is the JDBC connection. */
    <div> try </div>
    <div>{ </div>
    <div>
    <b>vendorConn</b> = ((WLConnection)logicalCon).getVendorConnection();
    </div>
    <div>
    //Calling the procedure
    </div>
    <div>
    //java.util.Map childMap1 = JDBCcon.getTypeMap();
    </div>
    <div>
    java.util.Map childMap1 = <b>vendorConn</b>.getTypeMap();
    </div>
    <div>
    childMap1.put("SST_ROUTE_ENTRY", Class.forName("svm.stport.ejb.StaticRouteEntry"));
    </div>
    <div>
    //JDBCcon.setTypeMap(childMap1);
    <b>vendorConn</b>.setTypeMap(childMap1);
    </div>
    <div>
    // Create an oracle.sql.ARRAY object to hold the values
    </div>
    <div>
    /*oracle.sql.ArrayDescriptor arrayDesc1 = oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", JDBCcon); */
    </div>
    <div>
    oracle.sql.ArrayDescriptor arrayDesc1 =
    oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", <b>vendorConn</b>); // here if i use the JDBCcon it works perfectly.... <u>^%^%^%</u>
    </div>
    <div>
    code to fill in the sst route entry array....
    .....arrayValues1 */
    </div>
    <div>
    /* oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, JDBCcon, arrayValues1); */
    </div>
    <div>
    oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, <b>vendorConn</b>, arrayValues1);
    </div>
    <div>
    callStatement = logicalCon.prepareCall( "? = call procName(?, ?, ?)");
    </div>
    <div>
    /* ..code to set the ?s ie array1 */
    </div>
    <div>
    callStatement.execute();
    </div>
    <div>
    }catch(Exceptio e){
    </div>
    <div>
    }</div>
    <div>
    finally </div>
    </div>{</div>
    <div>System.out.println(" I ve come to finally"); </div>
    <div>}</div>
    <div>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~code snippet ends here ~~~~~~~~~~~~~~``
    </div>
    I have observed that the control immediately comes to the finally block after the call to the createDescriptor line above with <u>^%^%^%</u> in the comment. If i use the JDBCCon in this line...it works perfectly fine.
    Any pointers to where anything is getting wrong.
    I have jst set the vendorCon to null in the end of the file and not closed it. Subsequently i have closed the logicalCon. This has been mentioned in some of the thread in this forum also.
    Thanks,
    -jw

    Jatinder Wadhwa wrote:
    I 've gone through various threads relating to the topic of Oracle Arrays and the getVendorConnecton API call to avoid the class Cast Exception.. i ve used all these but am still facing the problem...
    I would appreciate it if some one could resolve the following queries :
    I am using Weblogic 8.1 SP5 with oracle 8i
    1. I read that the need to use the getVendorConnection API to make pl/sql proc calls with oracle arrays from the WL Server wont be required to avoid classCastException...
    I tried to use the connection from the WL connection pool ..but it didnot work....I used the getVendorConnection API ..which also doesnot seem to work..
    I got the Heurisitc Hazard exception...I used the Oracle 9i driver ie ojdbc14.jar ...after this the exception is not coming but still the code doesnt seem to work...
    the snippet of the code is pasted below :
    ~~~~~~~~~~~~~~~~~~~~~~~code is : ~~~~~~~~~~~~~~~~~~~Hi. Show me the whole exception and stacktrace if you do:
    try
    vendorConn = ((WLConnection)logicalCon).getVendorConnection();
    java.util.Map childMap1 = vendorConn.getTypeMap();
    childMap1.put("SST_ROUTE_ENTRY" Class.forName("svm.stport.ejb.StaticRouteEntry"));
    vendorConn.setTypeMap(childMap1);
    oracle.sql.ArrayDescriptor arrayDesc1 =
    oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR",
    vendorConn);
    oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, vendorConn, arrayValues1);
    callStatement = logicalCon.prepareCall( "? = call procName(? ? ?)");
    callStatement.execute();
    }catch(Exception e){
    e.printStackTrace();
    finally
    try{logicalCon.close();}catch(Exception ignore){}
    System.out.println(" I ve come to finally");
    /*below :
    logicalCon is the Connection from the WL connection pool
    JDBCcon is the JDBC connection. */
    <div> try </div>
    <div>{ </div>
    <div>
    <b>vendorConn</b> = ((WLConnection)logicalCon).getVendorConnection();
    </div>
    <div>
    //Calling the procedure
    </div>
    <div>
    //java.util.Map childMap1 = JDBCcon.getTypeMap();
    </div>
    <div>
    java.util.Map childMap1 = <b>vendorConn</b>.getTypeMap();
    </div>
    <div>
    childMap1.put("SST_ROUTE_ENTRY", Class.forName("svm.stport.ejb.StaticRouteEntry"));
    </div>
    <div>
    //JDBCcon.setTypeMap(childMap1);
    <b>vendorConn</b>.setTypeMap(childMap1);
    </div>
    <div>
    // Create an oracle.sql.ARRAY object to hold the values
    </div>
    <div>
    /*oracle.sql.ArrayDescriptor arrayDesc1 = oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", JDBCcon); */
    </div>
    <div>
    oracle.sql.ArrayDescriptor arrayDesc1 =
    oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", <b>vendorConn</b>); // here if i use the JDBCcon it works perfectly.... <u>^%^%^%</u>
    </div>
    <div>
    code to fill in the sst route entry array....
    .....arrayValues1 */
    </div>
    <div>
    /* oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, JDBCcon, arrayValues1); */
    </div>
    <div>
    oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, <b>vendorConn</b>, arrayValues1);
    </div>
    <div>
    callStatement = logicalCon.prepareCall( "? = call procName(?, ?, ?)");
    </div>
    <div>
    /* ..code to set the ?s ie array1 */
    </div>
    <div>
    callStatement.execute();
    </div>
    <div>
    }catch(Exceptio e){
    </div>
    <div>
    }</div>
    <div>
    finally </div>
    </div>{</div>
    <div>System.out.println(" I ve come to finally"); </div>
    <div>}</div>
    <div>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~code snippet ends here ~~~~~~~~~~~~~~``
    </div>
    I have observed that the control immediately comes to the finally block after the call to the createDescriptor line above with <u>^%^%^%</u> in the comment. If i use the JDBCCon in this line...it works perfectly fine.
    Any pointers to where anything is getting wrong.
    I have jst set the vendorCon to null in the end of the file and not closed it. Subsequently i have closed the logicalCon. This has been mentioned in some of the thread in this forum also.
    Thanks,
    -jw

Maybe you are looking for

  • Hi All, I am using JDeveloper 10.1.3.5 for R12.2.4. I am getting an error after deploying my OAF page to application.

    I have developed a custom OAF page with multiple VO, EO and single AM. Below is my directory structure server/ AM, VO schema/server/ EO LOV/server/ LOV webui/ CO, Pages My page is running perfectly from JDeveloper and all functionalities are working

  • Ical not syncing to mobileme after upgrade

    upgraded to new mobileme calendar. i cannot get my calendar to show up in mobileme. i have already tried resetting and syncing from my computer to mobileme. stuff on my computer calendar still does not show up. it will sync from mobileme to the compu

  • Rights to Files and Folders

    I've created an application object and Associated a user to it. I've also added to the "Rights to Files and Folders" tab a directory where I want the user of the object, access to a certain folder where the .fil files are at. Full rights given (SRWCE

  • Uninstalling Microsoft Office 2004 -

    Hi, i was wondering what happens to the Microsoft Word files that i have saved on my hard drive once i uninstall the suite. Of course i can back up the files etc, but i thought that it would be easier if perhaps the files stayed where they were, mayb

  • Using Xcode for a 2008 MacBook with OSX 10.6.8

    I bought a MacBook 2008 and it has OSX 10.6.8 on it.  I wanted to use this computer to develop apps and download Xcode but it did not work with my computer.  I then bought Mountain Lion thinking it would update my sytem to use Xcode but it would not