Passing vectors

Does anyone have any examples of passing a vector from method to method?

I agree with the principle that you might need access to methods not defined in List but in this case I really don't think it's necessary. What could you use the Vector for other than a dynamic size list? Why would you need to call setSize()? By saying that the method takes a List you have documented the concept that the method does something with a list, not necessarily a Vector. It's confusing to specify a Vector in the method because it leads you to believe that it does some Vector specific stuff to it, which it most likely doesn't.
Regardless, Vector shouldn't be used because it's now a legacy class. Let's all join the 21st century and start using ArrayList :-). And don't give me the, "but Vector's synchronized and Arraylist isn't" argument.
List list = Collection.synchronizedList(new ArrayList());

Similar Messages

  • Passing vectors in a JSP Page

    Hi All,
    Can anybody please tell me as how I can pass vectors from a page to another page and how Can I retieve the value from the next page?
    Thanks,
    Aarthy

    I am using this code in the first page
    request.getSession.setAttribute("vec",v2);In the Recipient page
    Vector v5=new Vector();
    v5=(Vector)request.getSession().getAttribute("vec");I am getting nullPointerException when i try to get
    the size of the vector.Can anyone tell as where I am
    going wrong?
    Thanks,
    AarthyHow did u delclare your vector v2
    did u say
    Vector v2 = new Vector()
    session.setAttribute("vec",v2);
    if you just have said
    Vector v2 ;
    session.setAttribute("vec",v2);
    and trying to access v2.size() will throw NULL pointer exception
    good luck
    KM

  • Passing vector of object with multiple datatype

    Hi
    I want to pass vector of objects to stored procedure and I am facing some problem
    please suggest is it possible or I need to follow some other way.
    I have one class detail with two attributes i.e int ID and string course
    In main I have created 1000 objects of different ID and course and pushed back the objects to avector of detail and passed to a function my function is
    void bulkdatainsert(vector<detail>rec)
    stmt = conn->createStatement ("begin storeBulk(:1);end;");
         stmt->setMaxIterations(rec.size());
         stmt->setMaxParamSize(1,1024);
         setVector(stmt,1,rec,"course"); // The error coming here
    The error is due to the type rec .
    I want to know can we pass objects of multiple data to stored procedure through OCCI ?
    If not do we need to break every attribute and make vector of corresponding attributes and pass to stored procedure?
    please suggest me
    Thanks

    I think Custom objects are not supported directly.
    Following are the normal ones which you can use
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector< T > &vect,
    const string &schemaName,
    const string &typeName);
    Intended for use on platforms
    where partial ordering of function
    templates is not supported, such
    as Windows NT. Multibyte
    support.
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<T* > &vect,
    const string &schemaName,
    const string &typeName);
    Intended for use on platforms
    where partial ordering of function
    templates is supported. Multibyte
    support.
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<BDouble> &vect
    const string &sqltype);
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<Bfile> &vect,
    const string &schemaName,
    const string &typeName);
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<BFloat> &vect
    const string &sqltype);
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<Blob> &vect,
    const string &schemaName,
    const string &typeName);
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<Blob> &vect,
    const UString &schemaName,
    const UString &typeName);
    Sets a const Blob vector; UTF16
    support.
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<Clob> &vect,
    const string &schemaName,
    const string &typeName);
    Sets a const Clob vector;
    multibyte support.
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<Clob> &vect,
    const UString &schemaName,
    const UString &typeName);
    Sets a const Clob vector; UTF16
    support.
    void setVector(
    Statement *stmt,
    unsigned int paramIndex,
    const vector<Date> &vect,
    const string &schemaName,
    const string &typeName);
    Sets a const Date vector;
    multibyte support.

  • Passing vectors or whatever

    writing video store applet for school.
    applet is main menu only, create frames for other duties(i.e. add a new customer...etc.)try to pass vectors to other frames from applet but get null pointer exception when I try to load vector with object.
    any ideas.
    thanks

    here is a pert of the code, I tried to highlight the problem spots
    import javax.swing.*;
    import javax.swing.JApplet.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.awt.Font;
    public class videoApp extends JApplet implements SwingConstants{
         private JFrame newVideo,newCustomer,newRental;
         private Vector customerList,videoList,rentaList;
         private addCustomer newCust;
         private addVideo newVid;
         //,newVideoPanel;
         private JButton transaction = new JButton("Video Rental");
         private JButton addCust = new JButton("New Customer");
         private JButton addVideo = new JButton("New Video");
         private JButton listVideo_customer = new JButton("Videos/Customer History");
         private JButton listCustomer_video = new JButton("Customer/Video History");
         public void init(){
              Container appPane = getContentPane();
              appPane.setLayout (new FlowLayout ());
              appPane.add(transaction);
              appPane.add(addCust);
              appPane.add(addVideo);
              appPane.add(listVideo_customer);
              appPane.add(listCustomer_video);
              pass vector to class
         --->newCust = new addCustomer();//(customerList);<---
              newVid = new addVideo();
              addCust.addActionListener(new ActionListener () {
                                  public void actionPerformed (ActionEvent event) {
                                  newCust.show();
    }//ends videoApp
    import javax.swing.*;
    import javax.swing.JApplet.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.awt.Font;
    //should extend JPanel instead creat frame in videoApp add addcustomer?
    class addCustomer extends JFrame implements SwingConstants{
    private String tmpName,tmpAddress,tmpPhone,tmpId;
    private static int i = 100;//for id
    private Customer cust;
    private Vector custList = new Vector();
    private int width;
    private int height;
    JLabel header = new JLabel ("Add A Customer");
    JLabel name = new JLabel ("Name");
    JTextField nameTxt = new JTextField("",20);
    JLabel address = new JLabel ("Address");
    JTextField addressTxt = new JTextField("",20);
    JLabel phone = new JLabel ("Phone");
    JTextField phoneTxt = new JTextField("",20);
    JLabel id = new JLabel ("Id");
    JTextField idTxt = new JTextField("",20);
    JButton addButton = new JButton("Add Customer");
    JButton exitButton = new JButton("Close");
    public addCustomer(){//(Vector v){
              *****receives vector from applet
              custList = v;
              Toolkit tk = Toolkit.getDefaultToolkit();
              Dimension size = tk.getScreenSize();
              width = size.width;
              height = size.height;
              setSize(width/2,height/2);
              setLocation(width /4, height / 4);
              setTitle("New Customer");
              Image img = tk.getImage("tv.gif");
              setIconImage(img);
              Container contentPane = getContentPane ();
              GridBagLayout custLayout = new GridBagLayout();
              contentPane.setLayout(custLayout);
              GridBagConstraints custConstraints = new GridBagConstraints();
              setConstraints(custConstraints,0, 0, 2, 1);
              custConstraints.insets.bottom = 10;
              header.setFont(new Font("Arial", Font.ITALIC, 24));
              contentPane.add(header,custConstraints);
              custConstraints.insets.bottom = 2;
              setConstraints(custConstraints,0,1, 1, 1);
              contentPane.add(name,custConstraints);
              setConstraints(custConstraints,1, 1, 1, 1);
              contentPane.add(nameTxt,custConstraints);
              setConstraints(custConstraints,0,2, 1, 1);
              contentPane.add(address,custConstraints);
              setConstraints(custConstraints,1,2, 2, 1);
              contentPane.add(addressTxt,custConstraints);
              setConstraints(custConstraints,0,3, 1, 1);
              contentPane.add(phone,custConstraints);
              setConstraints(custConstraints,1,3, 2, 1);
              contentPane.add(phoneTxt,custConstraints);
              setConstraints(custConstraints,0,4, 1, 1);
              contentPane.add(id,custConstraints);
              custConstraints.insets.bottom = 10;
              setConstraints(custConstraints,1,4, 2, 1);
              idTxt.setEditable(false);
              idTxt.setBackground(Color.white);
              contentPane.add(idTxt,custConstraints);
              //custConstraints.insets.right = 50;
         setConstraints(custConstraints,0,5, 1, 1);
              contentPane.add(addButton,custConstraints);
              //custConstraints.insets.right = 0;
         setConstraints(custConstraints,1,5, 1, 1);
              contentPane.add(exitButton,custConstraints);
              exitButton.addActionListener(new ActionListener () {
                        public void actionPerformed (ActionEvent event) {
                        setVisible(false);
              addButton.addActionListener(new ActionListener () {
                   public void actionPerformed (ActionEvent event) {
                        tmpId = createId();
                        idTxt.setText(tmpId);
                        cust = new Customer(nameTxt.getText(),addressTxt.getText(),phoneTxt.getText(),tmpId);
                        System.out.println("Name: "+cust.getName()+" Address: "+ cust.getAddress()+" Phone: "+ cust.getPhone()+" Id: "+ cust.getId());
                        ****null pointer exception***
                        custList.addElement(cust);
                        //System.out.println("Name: "+ nameTxt.getText());
                        //System.out.println("Name: "+ cust.getName() +" Address: "+ cust.getAddress()+" Phone: "+ cust.getPhone()+" Id: "+ cust.getId());
    /*exitButton.addActionListener(new ActionListener () {
                                  public void actionPerformed (ActionEvent event) {
                                  Enumeration customerList = custList.elements();
                                  while(customerList.hasMoreElements())
                                       cust= (Customer)customerList.nextElement();
                                       System.out.println("Name: "+cust.getName()+" Address: "+ cust.getAddress()+" Phone: "+ cust.getPhone()+" Id: "+ cust.getId());
         private void setConstraints(GridBagConstraints component,int x, int y, int w, int h) {
         component.gridx = x;
         component.gridy = y;
         component.gridwidth = w;
         component.gridheight = h;
         private static String createId()
              String id;
              id = "C" + i ;
              i++;
              return id;
    }//ends addCustomer

  • Problem in passing vector from an applet to servlet

    Hi,
    I m facing problem in reading an object in the servlet (that i send from an applet). I have used BufferedInputStream ... The servlet reads the object but it takes about 30 seconds to do this ... If i don't use BufferedInputStream, it gives an "error reading inputstream header" ... if i use it, it take 30 seconds ... i m using netscape ent. server 4.0 ...
    Servlet code is as follows :
    try {
    InputStream in = req.getInputStream();
    inputFromApplet = new ObjectInputStream(new BufferedInputStream(in));
    saveVector = (Vector)inputFromApplet.readObject();
    I don't understand why it takes so long ... is there any other way ? Please help on this ... you may email me on [email protected]
    Thanks in advance..

    When you send a Vector through a stream, it must not only pass the Vector itself, but all the objects that the Vector refers to, all the objects that those objects refer to, and so on. Combine all this data with a slow internet connection, and passing what may seem like a small Vector could take minutes or hours.
    Are you sure you're passing a very small amount of data over a fast connection?

  • Passing vector into class/methods

    I am new to Vectors check this simple code out. I am trying to pass a vector onto another class then add an integer element to it. I see that its looking for an identifier but i dont unerstand how the code is for an identifier for a vector.
    ERRORS: .\Remove.java:4: <identifier> expected
         public static void AddIntegers(varray);
    ^
    .\Remove.java:4: ')' expected
         public static void AddIntegers(varray);
    ^
    .\Remove.java:4: cannot resolve symbol
    symbol : class varray
    location: class Remove
         public static void AddIntegers(varray);
    ^
    C:\Computer Work\Lab4\RemoveTest.java:11: cannot resolve symbol
    symbol : method varray ()
    location: class RemoveTest
              rm.AddIntegers(varray());
    ^
    .\Remove.java:4: missing method body, or declare abstract
         public static void AddIntegers(varray);
    ^
    .\Remove.java:6: cannot resolve symbol
    symbol : variable varray
    location: class Remove
              varray.AddElement(new Integer(13));
    ^
    6 errors
    Tool completed with exit code 1
    import java.io.*;
    import java.util.*;
    public class RemoveTest
         public static void main(String[] args)
              Vector varray = new Vector();
              Remove rm = new Remove();
              rm.AddIntegers(varray);
              System.out.println(varray);
    public class Remove
         public static void AddIntegers(varray);
              varray.AddElement(new Integer(13));

    I think the question whether you should use Vector over arrays, but rather should you use Lists over arrays. Vectors are kind of deprecated. You should be using the Collections Framework as a whole, and that means that ordered items are in java.uti.Lists, where are a kind of java.util.Collection, and a Vector is just a particular kind of List, and not necessarily even the best kind -- an ArrayList or LinkedList is often better.
    The advantage of arrays over Lists is that they can hold primitive types trivially. You can only hold objects in Lists, so you can put primitive class wrapper objects in Lists, but that has its disadvantages. Apparently in JDK 1.5 there's some syntactic sugar to make this easier, but there are still other disadvantages.
    The advantages of Lists over arrays are like what you mentioned -- things like resizings are automatic, there are lots of convenience methods, etc. The Collections Framework provides an abstraction of, well, collections, which is a good thing over futzing with details like with arrays, frequently.

  • Passing Vectors to Methods

    import java.util.*;
    public class usingVectors
    static Scanner console = new Scanner(System.in);
    public static void main(String[] args)
              int VECTOR_SIZE;
              System.out.print("Enter the size of the array: ");
              VECTOR_SIZE = console.nextInt();
              System.out.println();
    Vector<Integer> listA = new Vector<Integer>();
    System.out.print("Enter " + VECTOR_SIZE + " integers: ");
    fillArray(listA, VECTOR_SIZE);
    System.out.println();
    System.out.print("List of Integers that you inputted: \n ");
    printArray(listA, VECTOR_SIZE);
    System.out.println();
    System.out.println("The position of the smallest integers in the array is: " + indexSmallest(listA, VECTOR_SIZE));
    System.out.println("The smallest integer in the array is: " + listA[indexSmallest(listA, VECTOR_SIZE)]);
    public static void fillArray(int list, int sizeOfVector)
    int index;
    for (index = 0; index < sizeOfVector; index++)
    list[index] = console.nextInt();
         public static void printArray(int list, int sizeOfVector)
              int index;
              for (index = 0; index < sizeOfVector; index++)
              System.out.print(list[index] + " ");
         public static int indexSmallest(int list, int sizeOfVector)
              int index;
              int smallIndex = 0;
              for (index = 0; index < sizeOfVector; index++)
              if (list[smallIndex] > list[index])
         smallIndex = index;
              return smallIndex;
    Im trying to pass a vector to a method. Im not sure what i am doing wrong if anyone could look at what im doing wrong i would appreciate it.
    ER:usingVectors.java:19: fillArray(int,int) in usingVectors cannot be applied to (java.util.Vector<java.lang.Integer>,int)
    fillArray(listA, VECTOR_SIZE);

    My first problem was to write a method, smallestIndex that takes as its parameters an int array and its size. Return the smalles element in the array and its postion. Now i have that done and it was good. He wants us to change that program to use vectors. So i feel like i have done most of it right but like you said the error. It won't pass the vector through to the method. I believe
    ok thank you. I guess what i should ask you now. In my line of code. How do i set the parameters to pass a Vector instead of the int?
    THANK YOU FOR YOU HELP
    Vector<Integer> listA = new Vector<Integer>();                     
            System.out.print("Enter " + VECTOR_SIZE + " integers: ");                       
            fillArray(listA, VECTOR_SIZE);  **This is where i call my method with the vector name listA, and the int VECTOR_SIZE, it pops the problem here or would it be in the declaring the new varibles at the start of the method**                      
            System.out.println();                                  
            System.out.print("List of Integers that you inputted: \n     ");                       
            printArray(listA, VECTOR_SIZE);                       
            System.out.println();                                        
            System.out.println("The position of the smallest integers in the array is: " + indexSmallest(listA, VECTOR_SIZE));  
            System.out.println("The smallest integer in the array is: " + listA[indexSmallest(listA, VECTOR_SIZE)]);
        public static void fillArray(int list, int sizeOfVector) *Or would it be here?*
            int index;
            for (index = 0; index < sizeOfVector; index++)
                list[index] = console.nextInt();
        }

  • Pass Vectors To HTML or SCript and Another Problem....HELP...PLEASE....

    Hi,
    I am creating a Servlet project.
    I want to create screen#2 depending on what values are inputed in Screen#1.
    Basically i want to Dynamically change the "Document TYpe" depending on First or last name....
    The main thing is passing either a Vector or Array from screen#1 to generate "Document Type" in Screen#2.
    How can i pass a Vector or array to either HTML or JavaScript...
    Screen2 uses frames sets is there a better way to do this so I don't have to call two different files from one frame set file...
    Any Help will be greatly Appreciated....
    Thanks in advance...
    Screen#1:
    |---------------------|
    |Firstname:___________|
    |           |
    |Lastname:____________|
    |           |
    | ----------- |
    | | submit | |
    | ----------- |
    |           |
    |---------------------|
    Screen#2:
    |-----------------------|--------|
    |Frame1           |Frame2 |
    |                |      |
    |                |      |
    | Image           |Document|
    |                |Type      |
    |                |      |
    |                |     |
    |-----------------------|--------|

    Dynamically create a JavaScript array that can be accessed from either HTML page.
      <Script language="JavaScript">
      var recieveArray = [
       <% Vector v = (Vector) request.getAttribute("passedVector");
           for (int i = 0; i < v.size(); i++) { %>
                <%= (i != 0) ? "," : "" %>
                "<%= (String)v.elementAt(i) %>"
           <% } %>
        ];Just an illustration and not guaranteed to compile or run.

  • Passing vectors into JSP from Servlet and passing data back to Servlet

    I have been building an MVC application.
    It has a controller which instantiates classes and evokes methods to
    populate vectors. These vectors are then passed into a JSP. This part of the application works fine.
    What I am having trouble with is a new JSP I have designed; this will
    display the data that is actioned by the FORM action. This is actioned
    based on the Search criteria entered by the user. Based on this a further vector is populated and brought back to the JSP as a vector
    and this is rendered via the TABLE tag. Again this works fine.
    Against each of the rows displayed, I have a print checkbox which can be checked by the user. On checking the records they want to print, they should then hint a Print button which should go back to the Servlet and print the data. THIS IS WHERE I HAVE THE PROBLEM. On going
    back to the servlet the checkbox values are not displayed, rather
    the values that initially populate the JSP. How do I get these new values back into the vector and hence accessible from the Servlet.
    Any help with be very much appreciated.
    Chris

    Thanks for this.
    Just to clarify I am not using Struts.
    What I am having difficulties with is the fact that:
    I can't get the checked values back to the Servlet - they keep the values they have in the bean - so as part of instantiating the bean class I set the value of the item to 'off'. The user will then check
    the checkbox which should presumbably set the value to 'on'. This isn't happening because the setter method of the bean is not evoked again
    because I don't come into this JSP again - the Servlet has finished here
    and now needs to print the records. It can't do this because as
    far as it is concerned nothing has changed since it last passed through
    the vector to the JSP.
    Even when I do the following:
    Enumeration paramNames = request.getParameterNames();
    String param = null;
    while (paramNames.hasMoreElements())
    param=(String)paramNames.nextElement();
    System.out.println("parameter " + param + " is " +
    request.getParameter(param));
    what comes back is the valus of 'off' as opposed to 'on'.
    The other thing is that 'request.getParameterNames()' only works
    with the first record in the vector, i.e. it doesn't fetch any other
    records that are rendered in the <TABLE> tag.
    In desperation is there anybody out there who can help me.
    Thanks
    Chris
    I am going to assume you are using a MVC framework
    like Struts or very similar (I am assuming that from
    the language you are using).
    When the servlet passes the vector back to the JSP
    page and you render the HTML that is passed back the
    client your Vector is gone. The Vector is not
    available at the HTML level that is being viewed at
    the browser.
    When the user selects the checkboxes and submits the
    page (by clicking the print button) the controller
    servlet (called ActionServlet in Struts, yours maybe
    called something else) forwards the request to the
    appropriate JavaBean and Servlet to process the
    request. Either the JavaBean has to recreate the
    Vector (not recommended) or the processing Servlet can
    (better). You can do this by recreating the Vector
    from scratch for the HttpRequest parameters or, at the
    time of the initial request, saving Vector to a
    session and then updating with the data you get back
    from the client (again from the HttpRequest
    parameters).
    Either way you have to work with
    HttpRequest.getParameter().

  • How to pass vector array to JasperReport

    I have a query looks like this... in my JasperReport. (select * from employee where employee_id = $P{Emp_ID} order by employee_id)
    I already created a vector array contains a list of employee IDs from database. Now, I want to pass the array into the query to get a specific list of employees.
    Similar to SQL prompt below.
    SQL> select * from employee where employee_id in (1,3,4,5,22,23,45) order by employee_id.

    jasontey,
    I'm doing the samething here but with arrays and I'm getting ClassCastException.
    Servlet1:Vector PatientInfoVector = new MdlPatient().getPatientInfo(userId,patientNumber);
    int patientLength = PatientInfoVector.size();
    MdlPatient[] PatientInfoArray = new MdlPatient[patientLength];
    for (int i=0; i<patientLength; i++)
    PatientInfoArray[i] = (MdlPatient)PatientInfoVector.elementAt(i);
    session.setAttribute("patientSession",PatientInfoArray);
    response.sendRedirect(response.encodeRedirectURL("/FsuSecurity/SrvSecurity"));
    SrvSecurity:
    MdlPatient PatientInfo = (MdlPatient)session.getAttribute("patientSession"); This is where I'm getting the ClassCastException.
    int patientNumber = PatientInfo.getPatientNumber();
    Thanks if you can help,
    Doug

  • How to pass VECTOR to a stream

    i need to pass this vertor to the server side..
    but i don't know what method to use.
    CODE
    VECTOR     
    send_to_server = new Vector();
    send_to_server.add(0,input_str_name);
    send_to_server.add(1,input_str_password);
    I ALREADY CREATED A SOCKET AND CALLED S AND ALSO HAVE THIS CODE FOR CONNECTION.
    //Create socket
    Socket s = new Socket(server, port);
    //input from server| bytes to char
    InputStream is = s.getInputStream();
    //to allows us to use more function | dis.readDouble
    DataInputStream dis = new DataInputStream(is);
    //send output to server |char to bytes
    OutputStream os = s.getOutputStream();
    //to allow us to use more function
    DataOutputStream dos = new DataOutputStream(os);
    s.close();
    PLEASE HELP ME TO SEND THE VERTOR WITH THE PROPER METHODS OR FUNCTION...

    hi,how are you
    why not try to use ObjectInputStream and ObjectOutputStream,thus all will become simply
    for example:
    ObjectOutputStream writeSocket = new ObjectOutputStream(connectedSocket.getOutputStream());/* connectedSocket=socket connected */
    writeSocket.writeObject(Your Vector Object);

  • Passing vector between java class and jsp page

    Hi,
    I think this is similar to the last post but anyways maybe somebody can help us both out bontyh.....I am getting an error saying undefined variable or class when i try to access a Vector which was returned in a class.
    Anyways anyone got any ideas?

    Maybe if you give some more information...

  • Vector in session

    Hi
    I am passing vector in session between two jsp's
    In the first jsp I have
    session.setAttribute("serialnumber_Vect",serialno_Vect);
    In the recieving jsp I have the following
    Vector serial_Vect = (Vector)session.getAttribute("serialnumber_Vect");
    But i am not able to see the values in the receiving jsp
    what is the problem
    Thanks
    Arn

    did u set your scope to session?

  • Getting the value from a hashtable

    Hi all,
    Can I get the value from a Hashtable by passing vector.toString() , in the get method?
    I am storing the key value pair using the key as vector.toString() as the key and a string value. When i am using the get method by passing vector.toString() I am getting an exception
    found : Object
    required : String.
    Thanks and regards
    Tanmoy

    Exception? "found: X required: Y" sounds more like a compiler error to me.
    You need to post the lines of code that cause the error so we can see what's going on.

  • Creating a new class

    Hi all,
    I am new to Java programming and trying to figure out some issues with a class
    This is the problem I am trying to solve
    1. I am trying to parse a xml and represent it in a JTable
    2. I have parsed the xml and stored it in vector of vector formate [rows, columns]
    3. Now I need to take input from the vector and fill in the table model
    //dataVector is a Vector of Vector
    CarrierData cData = (CarrierData) dataVector.elementAt(rowIn);
    above statement is one I have issue with, I am not sure how the 'CarrirData' class should be
    This is the undestanding I have:
    1. as dataVector is a vector of vector, when we do elementAt(row) this would return another vector
    2. CarrierData should be a class that has a constructor that has pass Vector as a parameter?
    3. Based on the vector elements when we do get of each item this can be returned as column value for the table!
    Can some one help me if the approach I am going with is a right way?
    --VR

    all,
    I was not able to post my ans earlier today Thanks all for the reply
    Here is the mistake what I did, as I mentioned I was trying the following
    1. Parse the xml file and store it in a Vector of Vector
    2. Read the Vector and add it to a CustomObjectTable model
    3. and use this new tableModel to populate the JTable
    The mistake I did was storing the data in Vector of Vector, which would work for a a normal DefaultTableModel , but as I was using a wrapper based CustomTableModel this did not work.
    according to the code I had pasted
    CarrierData cData = (CarrierData) dataVector.elementAt(rowIn);
    dataVector is a Vector of Class that would return an Object and when I typecast to the CarrierData, you can acccess all the methods underneath the class to set the column data
    So this is how I solved the issue
    Parsing the xml
    CarrierData rowData = new CarrierData();
    if((((Element)nodes).getAttribute(CID)) != null)
    rowData.setID(Integer.parseInt(((Element)nodes).getAttribute(CID)));
    so the CarrierData class will look as follows
    public classs CarrierData
    public CarrierData()
    protected int getID()
    return m_id;
    protected void setID(int id)
    m_id = id;
    protected int m_id;

Maybe you are looking for

  • How do I actually use home sharing between my apple computer and apple tv?

    I have current updates, have set up the computer and Itunes to share the music.  I have the library and get to the point where I can select a song and it shows me how long it will play with a cursor.  I cannot get the cursor to start the playing.  Sh

  • Bypass Login with Oracle Database

    hello, I am using Oracle forms 6i. i want to create an application that does not require any connection with Oracle database. My Application fetch all its data from an Excel file. I do not want Login with Database,so i want to byapass it. How can i d

  • Preserve formatting using paste special doesn't work.

    First off, I'm using a Mac. I'm currently watching a Total Training tutorial that says I should be able to paste formatted text from Microsoft Word 2008 to Dreamweaver CS3 using the Paste Special command, but I am unable to get this to work. Is this

  • Output type processing status

    Hello All, i have an output type for a delivery. whenever a new delivery is created or modified, i need to collect that information and write it to the application server, and also need to change the processing status of output type from yellow to gr

  • Some odd things after a reinstall

    Odd... Just a few odd problems I noticed after reinstalling OS X. A few of my shareware applications I downloaded still warn me that I downloaded it from the internet every single time I open it. _Probably because of Coversutra_ And when I quit iTune