Problem with filling up vector

Hello,
i'm having a problem with the following code; when i try to fill up the vector, it overwrites the previous values with the new, so the when i add the second item, the first item becomes the second too. So when i return the vector, all values are similar (the last).
public Vector getClients(){
Database singleton = Database.getDatabase();
User user=new User();
Vector clients = new Vector();
try{
singleton.openConnection();
ResultSet rs = singleton.getResultSet("SELECT * FROM tblClients");
while(rs.next()){
user.setNaam(rs.getString("naam"));
               user.setVoornaam(rs.getString("voornaam"));
               user.setNickname(rs.getString("nickname"));
               user.setEmail(rs.getString("email"));
               user.setPaswoord(rs.getString("paswoord"));
System.out.print("user added:" + user.getNickname() + "\n" );
clients.add(user);
System.out.println(user);
singleton.closeConnection();
}catch(SQLException sqle){
sqle.getMessage();
sqle.printStackTrace();
System.out.print(clients.size() + " users added\n");
return clients;
}

You are always adding the same user-Object to the Vector.
You should put the command
user=new User();inside the while-loop to have different objects for different users.

Similar Messages

  • Problem with filling nodes of a context with data

    hi,
    i've got the following problem with filling a controller context:
    the context of the controller looks like:
    Context
    |-Node1             0..n singleton
      |-Subnode1        0..n singleton
      | |-SubVal1.1
      | |-SubVal1.2
      |-Subnode2        0..n singleton
      | |-Subval2.1
      | |-Subval2.2
      |-Val1.1
      |-Val1.2
    that means every Element of Node1 should have its own Subnode-Elements & Val1-Values
    in wdDoInit() of the controller I fill the context like this:
    Collection Node1, SubNode1, SubNode2
    for (Iterator iter = Node1.iterator(); iter.hasNext;) {
       newNode1NodeElement = wdContext.createNode1Element();
       newNode1NodeElement.set... //setting the values
       wdContext.nodeNode1().addElement(newNode1NodeElement);
       for (Iterator iter2=Subnode1.iterator(); iter2.hasNext;) {
          newSubnode1NodeElement = wdContext.createSubnode1Element();
          newSubNode1NodeElement.set... // setting the SubVal1.x
          wdContext.nodeSubnode1.addElement(newSubnode1NodeElement);
       for (Iterator iter3=SubNode2.iterator(); iter3.hasNext;) {
          newSubnode2NodeElement = wdContext.createSubnode2Element();
          newSubNode2NodeElement.set... // setting the SubVal2.x
          wdContext.nodeSubnode2.addElement(newSubnode2NodeElement);
    i've got the impression, that <b>all</b> my SubNodes are filled in the <b>first</b> Node1-Element. is there an error in the code above? because in the first place, i see every values in the first Element of Node1-views and if i navigate to the next Element of Node1, every views are empty.
    for every Node (Node1, Subnode1, Subnode2) i've got an own view, that maps its context to the corresponding Node of the controller context, e.g for the SubNode1-View:
    Context                  Context
    |                        ....
    |- ViewNode      --->    ..|- Subnode1
      |- SubVal1.1   --->    ..   |-SubVal1.1
      |- SubVal1.2   --->    ..   |-SubVal1.2
    in these views, i navigate through the nodes via
    wdContext.nodeViewNode().move...()
    in the SubNode1-View i see the SubVal1.1, SubVal1.2 (that's what i want) <b>and</b> additional SubVal2.1, SubVal2.2 (that's what I don't want...)
    kind regards, achim
    ps: i've studied the Master/Detail-Tutorial and i think the choice for cardinality 0..n and type singleton is correct in my case.

    hmm, let's look at the code:
    for (Iteration Node1) {
      newNode1NodeElement = wdContext.createNode1Element();
      wdContext.nodeNode1().addElement(newNode1NodeElement);
      for (Iteration SubNode1) {
         newSubNode1NodeElement = wdContext.createSubNodeXElement();
         newNode1NodeElement.nodeSubNode1().addElement(newSubNode1NodeElement);
         for (Iteration SubNode1.1) {
            newSubNode1.1NodeElement = <b>wdContext</b>.createSubNode1.1Element();
            newSubNode1NodeElement.nodeSubNode1.1.addElement(newSubNode1.1NodeElement);
       for (Iteration SubNode2) {
          newSubNode2NodeElement = wdContext.createSubNode2Element();
          newNode1NodeElement.nodeSubNode2.addElement(newSubNode2NodeElement);
    is there an error in creating the SubNode1.1-Node (bold line)?
    if the code is correct, perhaps it's only a viewing problem:
    i use views that point on every node and display the values in that node. if i move in the view for Node1 to another node, the values for SubNode1 point to the correct values too, but the values for SubNode1.1 still stay on the old values. is the move of a grandfather node not correctly propagated to his first child?
    kr, achim

  • Problems with filling out PDF forms

    We have problems with filling out PDF-forms. Aotomatic filling of forms is deactivated and we use the Adobe Reader 11.0.05. The problem is: After some time the inputs are wrong put down in the form. For example: I write 120 and in the form stands 125. We have already extinguished the cache. Thanks for your help in advance.

    You will get that first message when the document has been changed in a way that invalidates the internal digital signature that's applied when a document is Reader-enabled. Certain changes are allowed (e.g., filling fields, commenting, signing) and will not invalidate the signature, but others are not. The exact cause of the change is often hard to track down, but it can be due to font problems, some type of file corruption, or something that Acrobat/Reader attempts to correct when the file is opened/saved. You will also get the message if the users system time is not correct and is currently set to some time before the document was Reader-enabled. It seems best to use the most recent version of Acrobat to enabled the documents and recent versions of Reader to work with them.
    It problem is probably not related to the user using anything in the Sign pane.

  • Sudden problem with fill layers

    I use Adobe Photoshop Elements 11.  Until recently, I've had no problem with fill layers.  I'd make a selection from the photo, then I'd make a layer of the selection, then I'd go to edit, fill layer, fill with background/foreground color.  Then the selection only would be filled.  Now, all of a sudden, I make the selection, make a layer of the selection, go to edit/fill layer/fill with background/foreground color, and the whole photo becomes filled with the fill color, and not just the selection.  I'm always on the selection layer, not the background or any other layer.  I've reset all the tool defaults, and I've even deleted the defaults file, but to no avail.  What's happening here?  How do I fix this?
    Thanks,
    Sue

    Sue and MichelB
    MichelB
    When I tried to help Sue with the inquiry, I was doing so based on what was written and my interpretation of it
    then I'd go to edit, fill layer, fill with background/foreground color.
    For me that Photoshop Elements 11 Full Editor, Edit Menu/Fill Layer and the issue did not fit.
    But if the route were as you have suggested Photoshop Elements 11 Full Editor, Layer Menu/New Fill Layer/Solid Color then everything would fall into place, centering around that option in the New Layer dialog "Use Previous Layer to Create Clipping Mask" being checked or unchecked.
    Sue
    We look forward to your follow up.
    Thank you both.
    ATR

  • Problem with 'Filling Space' described in Tim's Blog

    Dear Experts,
    I am using the Invoice Template described in the excellent Blog by Tim Dexter (Anatomy of a Template) to produce my own version. However, I am having problems with the 'Filling Space' described here: http://blogs.oracle.com/xmlpublisher/2007/03/anatomy_of_a_template_ii_heade.html
    My template is almost identical to the example, when I import XML data where there is only one record, the Filling Space does not pad out with enough empty rows so that the Total table is not at the bottom of the page, aligned with the watermark that I have. The code in the 'Filling Space' field is as in the Blog:
    <?if:not(count($invLines) mod $lpp=0) and ($start+$lpp>count($invLines))?><?for-each:$invLines?><?if:position()<$lpp - (count($invLines) mod $lpp)?>
    If the number of records is greater than half a page or more, then the padding is correct. This is even if, say on the third page there is just one record. Therefore, it seems the padding does not work if the number of records are less than half a page in total.
    Is this correct and does anyone have a solution - would be greatly appreciated.
    Many thanks,
    Mark

    "If the number of records is greater than half a page or more, then the padding is correct. This is even if, say on the third page there is just one record. Therefore, it seems the padding does not work if the number of records are less than half a page in total."
    This statement is wrong.
    Leave the if conditions logic,
    This is how it works,..
    xml contains 43 rows...
    each page you need 10 rows..
    after every 10th rows [using position mod 10 ,] , you put a page break...
    if the mod returns greater than 0, that means row filler has to come into effect now.
    what is the logic now to have row fillers is , 10 - 3 [position mod 10] , comes to 7... so seven blank rows should be inserted..
    this is how , it works...
    so the statement, saying, less than half of page, or something, wont come into this :).
    http://winrichman.blogspot.com/2008/09/limit-row-per-page.html

  • Problem with filling shapes

    Hello, I am new at this flash stuff and I need some help with filling objects I have went through just about every tool and every function and watched tutorials online and I cannot seem to do this.
    As this picture shows I have drawn a red circle but did not release the mouse to complete it
    This is What happened when I release the mouse
    In this photo I have selected the paint can to fill the circle
    In this photo I have tried multiple attempts to fill the circle
    Nothing seems to be working I cannot fill the circle I have created I cannot change the color(green) of the paintbrush or the pencil. Could somone please help me?

    what tool did you use to draw that circle?

  • Problem with Fill tool in Windows 7 Paint

    I've seen variations on this question (such as http://social.technet.microsoft.com/Forums/en-US/w7itprogeneral/thread/8afa9277-686a-44e0-b488-e5bee4611cb5/ ),
    but none seem to address the specific problem I'm having; namely, that the Fill tool in MS-Paint is disabled and remains that way, no matter what I do.  If I open a GIF for editing, no Fill tool.  If I select a bounded area, no Fill tool.  If
    I Select All, no Fill tool.
    I'm trying to modify a button face by changing the default color to a gray tone, to produce a "disabled" version.  Seems to me this should be the easiest thing in the world to do, but I jest cain't.  Ideas?

    Hi,
    Do you mean that the Fill with color is grayed out in MS paint?
    You may check the following:
    1. Try the
    system restore to go back to a previous status and check the result.
    To restore system will preserve all the software and files before the previous restore point. And all of your private date will be preserved.
    2. Run
    System File Checker tool and see how it works.
    Tracy Cai
    TechNet Community Support

  • Type Mapping Problem with java.util.Vector in Axis

    Hi,buddies,I want to use the Vector class as the return type of my service, but it seems that there isn't a built-in Ser/Deser factory for Vector, is it?So i think we need to provide our own Ser/Derser. and this is a very common problem,and i wonder how to write my own Ser/Derser, please give me some suggestion,thx!
    Best Regards:)

    Hi,I checked out the src of Axis 1.2, I found there is a org.apache.axis.encoding.ser.VectorSerializerFactory class and an according org.apache.axis.encoding.ser.VectorDeserializerFactory class.so in the deploy.wsdd i use them as the ser/deser factories in the TypeMapping part inside the service tag.everything goes well and i got no problem deploying the service to axis.But the problem is that when i try to invoke the service and get a vector as return(Suppose the components in the vector is instances of Movie class), the following error occured:
    org.xml.sax.SAXException: No deserializer for {urn:movies}Movie
    But it is a little bit confusing,for I declared the ser/deser factories for the bean class Movie(with built-in ser/deser factories of axis),and everything was going fine when i deployed the service to axis.So should i still use the TypeMappingRegistry or there are something i just missed.Please give me some suggestion,thx :)
    Best Regards:)

  • Problems with filling out/going back and editing filled out information and signing forms

    Users cannot fully fill out, edit and save forms--
    the forms were set up in InDesign CS6, then edited in Adobe Acrobat Pro 9 for all the form info and after that was set up the forms were saved as extended pdfs to allow adobe reader users to fill them out and sign.
    The users are having all kinds of issues with the forms and its been difficult to pin point the exact cause.
    Here are 2 errors:
    This document enabled extended features in Adobe reader. This document has been changed since it was created and use of extended features is no longer available. Please contact the author for the original version of this document.
    The security settings on this document prevent adding text and/or placing a signature on it from Adobe Reader. To fill out and sign this document you need to print it out.
    ---I've checked the security on the form and there is no security not allowing them to fill it out and I believe that originally they were able to but the form was saved and then they went back and were unable to edit it. I need to know if its something I need to do on my end or an instruction I need to give to them--steps to filling out and saving programs vesions to use etc..
    sorry for some of the holes in the info. the form was created for a client and they sent it out to their employees so I do not have direct contact with the people having the issues just two screenshots, and I have not been able to find an answer that works--this is what I thought would help but it didnt:
    It should solve the signature/adding text  issue—From : http://forums.adobe.com/thread/987256
    Your user should go to Extended pane in Reader to apply a digital signature to the Reader extended PDF.
    The user is probably trying to use the Sign pane in Reader which has some options disabled according to the document permissions. The new Sign pane in Reader is an integration with Adobe EchoSign service in the sense that it enables an end user to fill-up documents, electronically sign and then send a PDF document, without having the need to print them. The Sign pane provides two options to the user:
    1 - Fill and Sign: Here the user can place text using 'Add Text'. Users can add arbitrary text to a PDF, eg. in documents where Reader cannot interact with the document even though the document looks like a form, in forms where user cannot save the filled-up form. In such cases the only option a user has is to print the form, fill it and then fax or fedex the filled up document to the author or scan it and send it electronically. Using the Sign pane in Reader, a user can add text and also electronically sign the document (this is not the same as digital signature) using an image of their signature. He can create a 'signature' from a scanned paper which has user's handwritten signature and place it on the PDF.
    2 - Send for Signature: Here the user is sent to EchoSign for collecting signatures from others.

    You will get that first message when the document has been changed in a way that invalidates the internal digital signature that's applied when a document is Reader-enabled. Certain changes are allowed (e.g., filling fields, commenting, signing) and will not invalidate the signature, but others are not. The exact cause of the change is often hard to track down, but it can be due to font problems, some type of file corruption, or something that Acrobat/Reader attempts to correct when the file is opened/saved. You will also get the message if the users system time is not correct and is currently set to some time before the document was Reader-enabled. It seems best to use the most recent version of Acrobat to enabled the documents and recent versions of Reader to work with them.
    It problem is probably not related to the user using anything in the Sign pane.

  • Problem with fill-in-blank questions

    I'm using powerpoint 2003 and Adobe presenter 7. When I create fill-in-blank questions in quiz, more detail: I have 5 textboxes in 5 sentences; after each sentence, I pushed "enter" to make a new line (of course, there is 1 textbox in each one). It seemed ok. But, when I presented it on the browser, they were disordered. There weren't any enters. Where I had used "enter" button, they were still on the same line; even, textbox I created at the middle of the sentence, but at the presenting time it jumped to the end of the sentence.
    How can I do to overcome this situation? Is that because of the properly between the ppoint 2003 and AP7? or another causes?
    Plz help me because I'm preparing to attend an important competition in my school.
    Tks so much!

    Hi
    I can see a bit of the problem you are talking about
    the issue is as follows
         1. Say you inserted a FIB question and inserted question text with new line characters (say 3 lines)
         2. You pressed OK and the quiz slide appears properly
         3. Say you went back to the FIB question in manage quiz again.
              a. The problem is present here
              b. The new line characters present are getting deleted which is an issue which has been reported.
              c. All you have to do is to re- enter the new line character in the question textbox and the output will appear fine            
    Even after this if you are still seeing the issue can you please share the ppt file, atleast the fill in the blanks slide, so that we can see what the problem is?
    thanks
    Mahesh Nayak
    Message was edited by: mkalyanp

  • Problems with filling of Setup table for 2LIS_03_UM

    I am not able to fill up this table. I mean its not getting filled thorugh TCode OLIZBW.
    Setup table for 2LIS_03_BF is getting filled up though.
    Can anyone foresee what can be the reason.
    Thanks PB

    Nope I am not. But the problem I have posted in my last note that i was getting -ve stock values which was resolved when i loaded the data with infosource 2LIS_03_UM in development. when I am testing it in QA I am not getting dat in this extractor.
    I had a chat with MM Functional Consultant , he said I probably wont get this data.
    Now I am not sure how will I be able to resolve the problem.
    Regards
    PB

  • Problem with filling the forms in Nokia browser af...

    Hello,
     I updated my Nokia 808 to FP2 successfuly. But i realized one problem in web browser and the new keyboard. For example when i want to write into a form box i can only see virtual keyboard. I cannot see what i type. If you want to test this, please open your local nokia website and click on support / e mail us. You will see a form which will ask your phone model and OS etc. Try to type into the boxes. Yesterday i failed to write anything. Also reaction is very slow. You can see what i m talking about in the attachments.
      Also with the new update, videos are not working correctly. Sometimes video player is crashing. Sometimes i see strange and colourful images while it is trying to play the video. Then it turns to normal and i see the video clearly.
      Im satisfied with some new things in the update but there are problems and slow downs. Some features are not working such as Nokia Social. I hope Nokia Team will find a solution. Thank you.
    Attachments:
    Fotoğraf0001.jpg ‏183 KB
    Fotoğraf0150.jpg ‏179 KB

    HI ilkerol,
    Welcome to Nokia Support Discussions!
    Thanks for the feedback! I tested the support form with the same results, the page was slow and kept on moving up to the top when I was typing in the textbox.  I tried it with a Lumia device, and even though I was able to fill the textbox without problems, the drop down menus did not work. Based on that experience, it seems that the form is meant to be used with a personal computer, not a mobile device. I will, however, escalate this issue in case there is a possibility of a quick fix. 
    As for the video issue, does this happen with all videos or just certain ones? Colorful images etc. usually mean that the video file encoding is somehow broken and the player cannot read it properly.
    Hope this helps!
    Puigchild
    If you find this post helpful, a click upon the white star at bottom would always be appreciated.
    If it also solves your problem, clicking ACCEPT AS SOLUTION below it will benefit other users!

  • Bapi_salesorder_createfromdat2 problem with filling Configuration values

    Hi All,
    I am trying to create a sales order using "bapi_salesorder_createfromdat2". Good part is I am able to create the sales order with item details, schedule line info and partners. However the BAPI did not fill the characteristic values.
    Here I am giving the code snippet and request you to help me in identifying what I am missing or where i am doing wrong.
    we checked in config and the material has perfectly configured for characteristics.
    LOOP AT it_soitem_dtls INTO lwa_soitem_dtls.
        wa_soitem_dtls = lwa_soitem_dtls.
        lv_posnr       = lv_posnr + 10.
        lv_configid    = lv_configid + 1.
        CONDENSE lv_configid.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = lv_configid
          IMPORTING
            output = lv_configid.
    * Fill the Item Configuration Characteristics
          wa_order_cfgs_ref-posex      = lv_posnr.
          wa_order_cfgs_ref-config_id  = wa_curef_out-config_id.
          wa_order_cfgs_ref-root_id    = wa_curef_out-inst_id.
          APPEND wa_order_cfgs_ref TO it_order_cfgs_ref.
          wa_order_cfgs_inst-config_id     = wa_cuinst_out-config_id. "lv_configid.
          wa_order_cfgs_inst-inst_id       = wa_cuinst_out-inst_id.
          wa_order_cfgs_inst-obj_type      = 'MARA'.
          wa_order_cfgs_inst-class_type    = '300'.
          wa_order_cfgs_inst-obj_key       = wa_soitem_dtls-material.
          wa_order_cfgs_inst-quantity      = wa_soitem_dtls-qty * 1000.
          CONDENSE wa_order_cfgs_inst-quantity.
          wa_order_cfgs_inst-quantity_unit = 'KG'.
          wa_order_cfgs_inst-complete      = 'T'.
          wa_order_cfgs_inst-consistent    = 'T'.
          wa_order_cfgs_inst-persist_id_type = 'G'.
          APPEND wa_order_cfgs_inst TO it_order_cfgs_inst.
          wa_order_cfgs_part_of-config_id  = wa_cuinst_out-config_id. "lv_configid.
          wa_order_cfgs_part_of-parent_id  = wa_cuinst_out-inst_id.
          wa_order_cfgs_part_of-inst_id    = '00000001'.
          wa_order_cfgs_part_of-obj_type   = 'MARA'.
          wa_order_cfgs_part_of-class_type = '300'.
          wa_order_cfgs_part_of-obj_key    = wa_soitem_dtls-material.
          APPEND wa_order_cfgs_part_of TO it_order_cfgs_part_of.
        wa_curef_in-posex     = wa_soitem_dtls-contractitem. "lv_posnr.
        wa_curef_in-config_id = wa_cuinst_out-config_id. "lv_configid.
        wa_curef_in-inst_id   = wa_cuinst_out-inst_id.
        APPEND wa_curef_in TO it_curef_in.
      wa_order_cfgs_value-config_id   = p_configid.
      wa_order_cfgs_value-inst_id     = p_instanceid.
      wa_order_cfgs_value-charc       = p_char.
      wa_order_cfgs_value-value       = p_val.
      APPEND wa_order_cfgs_value TO it_order_cfgs_value.
    ENDLOOP.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in         = wa_so_header_in
          convert                 = 'X'
        IMPORTING
          salesdocument           = gv_vbeln
        TABLES
          return                  = it_return
          order_items_in          = it_order_item_in
          order_schedules_in      = it_order_schedules_in
          order_partners          = it_so_partners
          order_cfgs_ref          = it_order_cfgs_ref
          order_cfgs_inst         = it_order_cfgs_inst
          order_cfgs_part_of      = it_order_cfgs_part_of
          order_cfgs_value        = it_order_cfgs_value
          order_cfgs_refinst      = it_curef_in
          order_text              = it_so_texts.
    * Roll back LUW if any error returned by BAPI otherwise commit
      READ TABLE it_return WITH KEY type = 'E'
                           TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = c_x.
      ENDIF.
    Thanks in advance for all your help.
    Rgds,
    Lakshmi
    Please use code tags to make your code easier to read
    Edited by: Rob Burbank on Dec 6, 2010 2:31 PM

    Soraya,
    You need to pass in the Pricing COnditions via the ORDER_CONDITIONS_IN and ORDER_CONDITIONS_INX parameters.
    eg.
    tbl_bapicond-itm_number = '000010'.
    tbl_bapicond-cond_type  = 'ZP01'.
    tbl_bapicond-cond_value = '100'.
    append tbl_bapicond.
    tbl_bapicondx-itm_number  = '000010'.
    tbl_bapicondx-cond_type   = 'ZP01'.
    tbl_bapicondx-update_flag = 'U'.
    tbl_bapicondx-cond_value  = 'X'.
    append tbl_bapicondx.
    Hope this helps.
    Cheers,
    Pat.
    PS. Kindly assign Reward Points to the posts you find helpful.

  • Problem with fill pattern in oracle reports 11g

    Hi all,
    regardless of the fill pattern we use, on paper lines with a fill pattern appear completely black
    no longer using a fill pattern is not an option as we have > 200 reports (migrated from 6i) that use them
    running such a report from the builder choosing paper layout does show the report output correctly on our development PCs
    development PC OS : XP
    WLS 10.3.3 (32 bit)
    Reports builder 11.1.1.3.0
    server : Win 2008 64 bit
    WLS 10.3.3 (64 bit)
    report output is PDF
    the way we work when a user prints a report, the pdf is created on the reports server and then send to the client using webutil and then the report is printed using Adobe Reader 9.3.2
    any ideas ?
    thx in advance
    Kr
    Martin

    anyone ?

  • Problem with TreeMap and Vector

    Hello,
    this is the problem I have:
    I declare a Vector like this:
    Vector<String> theVector = new Vector<String>();
    I put the String needed into the Vector:
    theVector.add("blabla")
    In the other hand I had created a TreeMap like this:
    private TreeMap<Integer, Vector<String>> theTreeMap;
    I now when I try to put the Key and the Element like this my program crash:
    theTreeMap.put(1096,theVector);
    I think I don't put the data on the good way in the TreeMap...
    Any Idea? Thank you very much

    In the other hand I had created a TreeMap like this:
    private TreeMap<Integer, Vector<String>> theTreeMap;
    I now when I try to put the Key and the Element like
    this my program crash:
    theTreeMap.put(1096,theVector);What do you mean?

Maybe you are looking for