Vector does not retain values in hashmap

There should be 200 different values in Vector Group_Privs, but all the values is the last value retrieved. Help!
Map map = new HashMap();
Vector Group_Privs = new Vector();
Database database = new Database();
ResultSet result = null;
String connection = Connection;
try
Connection con = database.getDesiredConnection(Connection);
PreparedStatement ps = null;
try
ps = con.prepareStatement("select GROUP_ID"
+" from group_table ");
result = ps.executeQuery();
int i=0;
while (result.next())
map.put ("GROUP_ID",(String)result.getString(1));
Group_Privs.add(map);
result.close();

import java.util.*;
public class Example {
    public static void main(String[] args) {
        List<Map<String, String>> list = new ArrayList<Map<String, String>>();
        addValues(list);
        retrieveValues(list);
    static void addValues(List<Map<String, String>> list) {
        for(int i=0; i<4; ++i) {
            Map<String, String> map = new HashMap<String, String>();
            for(int j=0; j<=i; ++j) {
                String s = String.valueOf(j);
                map.put(s, s);
            list.add(map);
    static void retrieveValues(List<Map<String, String>> list) {
        for(Map<String, String> map : list) {
            System.out.format("%nmap of size %d: %n", map.size());
            for(Map.Entry<String, String> e : map.entrySet()) {
                System.out.format("%s |-> %s%n", e.getKey(), e.getValue());
}[http://java.sun.com/docs/books/tutorial/collections/index.html]

Similar Messages

  • Scroll bar does not retain its position after or before pack

    Hi
    My Scroll bar does not retain its position after pack in my application.
    But i need to retain its state.
    My code snippet is :
    System.out.println("VAlue--->" + getHXValue());
    scrollPane.getHorizontalScrollBar().setValue(getHXValue());
    pack();
    My VAlue printed is 100.
    But my positon of scroll bar is at 0 th location.
    Can any one help me.....

    Swing related questions should be posted in the Swing forum.
    My code snippet is :Snippets don't help.
    If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",
    see http://homepage1.nifty.com/algafield/sscce.html,
    that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.

  • Error msg, "Maximum selection does not contain value 9999999999.

    Hi, I am getting this error wile doing Reclassification of HFM Movement.
    Error msg, "Maximum selection does not contain value 9999999999 of subassignment HFM CD2 & Asset Type "                                         
    in the Data Monitor, ( in Reclass Net Reserve). While running BCF task for a company for period 16/2009     
    Actually, We have converted the consolidation area from XX(2009) to YY(2010).
    Before this task, user has performed the balance carry forward.
    My Analysis is as follows:-
    Method Used in this Reclassification                                         
    RECYX (Reclassify HFM Movement at YE lvl 10)                                        
         TRIGGER                                   
         Items : 100-299, 9900-9999                                   
         HFM Movement Type : O200 to O300                                   
         Posting Level : 10                                   
         TARGET                                   
         Items : 100-299, 9900-9999                                   
         Move : O100C                                   
         Posting Level : 10                                   
         HFM CD2 and Asset type : Ticked                                    
    After TEST run in UCMON, the error message comes :-                                        
    The "HFM CD2 & Asset Type value 9999999999" is not maintained in Breakdown Categories Y500, Y700  etc.                                        
    Breakdown categories in Workbench                                        
    Maintained as "OPTIONAL, Initialized value allowed".                                        
    Single Selection                                         
    1A                                        
    1B                                        
    AR                                        
    GA                                        
    Default Selection                                        
    99999999999                                        
    BCS CUBE                                         
    HFM CD2 & Asset Type - coming blank               
    LOTR                                        
    HFM CD2 & Asset Type - Coming blank     
    Please help to go forward.
    In Anticipation,
    Deepankar Jain

    Thanks a lot Dan for the reply.
    Yes, the single selection is 1A, 1B etc, I agree that including this default value 9999999999 in single selection will resolve this issue, but the BREAK DOWN TYPE is OPTIONAL, that means It will also consider a blank value, right?
    Also, In the method defined for RECLASSIFICATION in workbench, in the TARGET parameters, the" HFM CD2 and Asset Type"  is blank but the "DEFAULT is TICKED" which makes it a mandatory derivation rule.
    Please correct me if I am wrong.
    Your replies on it are highly appreciated.
    Thanks and Regards,
    Deepankar

  • Maximum selection does not contain value 600 of subassignment Subitem-error

    Hi All,
    I'm getting the following error when i tried to load the file through data stream.
    Maximum selection does not contain value 600 of subassignment Subitem
    Message no. UCD1038
    Diagnosis
    The posting item 11100100 has breakdown category BR01 for which a maximum selection was maintained for subassignment Subitem. The current posting value, however, is not in this maximum selection.
    System Response
    The posting is not possible.
    Procedure
    Check the maximum selection and the posting.
    I have already refered the earlier threads but its of no use for me. I have checked my setting w.r.t to FS item breakdown category, Max selection in breakdown category and  sub items all the setting are fine, even i applied the OSS notes no-1074599 still i'm facing the same issue.
    Can any one help me with this regards, thanks in advance.
    Regards,
    Magesh

    Hi Dan,
    Yes, breakdown category has been assigned with a sub item category which in turn assigned to subitems and this sub item is a part of the sub item category which is assigned in max. selection.
    Let me know if you want any more information on the same.
    Regards,
    Magesh

  • MW64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program

    W64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program. The context options that show are the ones from original install. The workspace I set up is also gone. I have every explorer box and cleaner checked to save recent. Had to disable nivedia desktop software because of weird display conflict. Have Dell pro support and they cannot fix. Any ideas to help me with this would be appreciated.

    Self-solved!  I work in column view in Finder so get there in a Finder window with folders and files appearing.
    There really is no problem, just select an ITEM in the COLUMN before right-clicking!
    The "old" context menu will appear. If you click in the white space in that column (or anywhere in a Finder window) and then place the cursor over a folder or file WITHOUT selecting it and right-click you will bring up the secondary context menu - Open, Copy, Duplicate, View Options and a greyed out Labels option. No "Move to Trash".

  • Copy and Paste on Safari 5.0.2 does not retain formatting

    Hi there.
    I'm on Safari 5.0.2. and when I copy and paste something (in this case, on a message board--vBulletin, but it doesn't work on anything else) it does not retain the original formatting (for example--bold, italics, underline, etc.) If I copy something from Safari and paste it into another program, TextEdit for example, the formatting remains and works fine.
    This is extremely annoying. Anyone have any ideas?
    *If you're on Safari, try copying* and *pasting this sentence in a reply* --it will remove all the formatting for some reason. It will work in TextEdit, however. It's not just this message board software either...try it somewhere else too.
    Message was edited by: FINALBOSS

    Hi
    copying formatted text & pasting in Safari does retain the formatting, so long as the place you're pasting it supports varying fonts/styles.
    So copy/paste here, just shows as plain text.
    c/p to blogger.com in the 'compose' tab - works fine
    c/p to blogger in the 'html' tab - plain text
    same with textedit: paste from safari to textedit +in a plain text document+ -you get plain text.

  • HT1677 Safari when set to private browsing and cookies from sites I vist has a problem. I want it to keep cookies from sites I use such as my email and comic sites. Right now it does not retain cookies that set up my choices of comics as site internal fav

    Safari on the IPAD has the following problem.
    When set to private browsing and only accept cookies from sites I visit does not retain them after I shutdown Safari and then later restart it. I also found out that even if I leave it in background and close the cover of my case it will not retain the cookies even though I did not deactivate it.
    Things like email Ids and cookies that contain site specific favorites get deleted.
    Here is a site where you can set a series of favorites which get stored as cookies.
    http://www.seattlepi.com/comics-and-games/fun/Judge_Parker/
    Any Ideas... I have tried various settings but only public browseing keeps the cookies. I use private browsing to curtail popups and various trash from bothering me on my IPAD and Safari....

    Safari on the IPAD has the following problem.
    When set to private browsing and only accept cookies from sites I visit does not retain them after I shutdown Safari and then later restart it. I also found out that even if I leave it in background and close the cover of my case it will not retain the cookies even though I did not deactivate it.
    Things like email Ids and cookies that contain site specific favorites get deleted.
    Here is a site where you can set a series of favorites which get stored as cookies.
    http://www.seattlepi.com/comics-and-games/fun/Judge_Parker/
    Any Ideas... I have tried various settings but only public browseing keeps the cookies. I use private browsing to curtail popups and various trash from bothering me on my IPAD and Safari....

  • Is there a save option on iPhoto? Sometimes iPhoto does not retain the name on a face I've added to a photo.

    Sometimes iPhoto does not retain the name on a face I've added to a photo. I have 'added a face' then flipped to the next picture then back to that picture and the label has disappeared.

    No.  It's supposed to be automatic.  You might try repairing the library's database and then see if it still crops up now and then. If that doesn't help try rebuilding it the same way.
    Launch iPhoto with the Option+Command keys held down and select the database repair option in the rebild window:
    Then the rebuild option if necessary.
    OT

  • Function Module does not fetch value

    Hi All,
    I am using the fm RV_PRICE_PRINT_HEAD to fetch condition records. When I run this fm in SE37 for a particular document(vbeln) number, the values are fetched correctly into the internal tables TKOMV and TKOMVD.
    The same fm does not fetch values when I run for second time for the same document(vbeln). This means :
    1) I will go to SE37, type RV_PRICE_PRINT_HEAD, supply the export parameters in COMM_HEAD_I, execute it and obtain the condition records (Till this time absolutely fine)
    2) Now, press Back (F3), Let the export parameters in "COMM_HEAD_I" will remain same. Just press Execute (F8). Then condition values are not fetched.
    Could any body help in this regard...
    Thanks
    Thimmappa Hegde

    Hi
       I have given you the other alternative bcoz there is a limitation while calling this FM: RV_PRICE_PRINT_HEAD.
    If you see the comments and code of Include: LV61AA11, you can understand the problem.
    <b>* mechanism to controll which conditions are already part of table TKOMV
    Every time a pricing result is read from database the key is put into
    TABGL. Also TABGL is updated if we've lines in TKOMV assigned to a
    special key but entry in TABGL (case 2).
    Originally TABGL was established to handle following pathological
    case: condition successfully read from DB -> entry in TABGL. Then all
    read conditions where deleted during processing (e.g. manually
    deletion etc.). If we run into this routine again no records should
    be redetermined from DB...</b>
      read table tabgl with table key knumv = komk-knumv
           transporting no fields.
    Case 1:
    conditions have been already read because there is a fitting entry in
    TABGL. Exit immediately if caller doesn't want to force DB access.
      if sy-subrc eq 0. ---><b> First time SY-SUBRC NE 0 so no problem</b>   
         if generell_lesen ne 'X'. <b>--> Later runs SY-SUBRC  eq 0 and generell_lesen value is SPACE</b>.
            exit.
        endif.
      else.
      Hope this clarifies your doubt now.
    Kind Regards
    Eswar

  • I am using CS6 and when I go to save an image for Web the image does not retain its quality

    I am using CS6 and when I go to save an image for Web the image does not retain its quality. The first week I did this it worked just fine and now the images save very pixely.
    Here is a screenshot of my image on the artboard as I am editing it
    Here is a screenshot of the image as I'm trying to save it for Web
    As you can see, the image becomes pixely. I have tried to save it as every type of png and jpeg but nothing seems to work. I have no idea why it has started to do this. Please help!

    Change None to Art optimized then click apply(alteast in CS5 there was an apply, believe they removed that in CS6 as so many people missed that part).

  • Browser: Print to PDF does not retain hyperlinks

    Hi,
    I was wondering if someone can give me some guidance.
    I have several html pages that contain numerous hyperlinks throughout the page
    On each page there is a javascript print button (ie. onclick="window.print();returnfalse..........)
    Whenever a user chooses the option from the print dialog box to print the page to Adobe PDF,  the output (pdf) does not retain the hyperlinks.
    Is there a way, feature, or product that will allow external users to print to pdf and still have the hyperlinks work?

    Printing to PDF never includes interactive elements - it is what it says, a digital copy of a printed page. No links on a sheet of paper = no links on a PDF printout.
    To retain interactive content you must save the page as a PDF, for example using the Acrobat plugin for IE or Firefox.

  • Freehand MX does not retain activation.

    I had to reinstall Freehand MX on my new laptop. I have the new activation code from Adobe, it opens but does not retain activation. I must enter serial number every time.  How can I fix this?

    Hi SeaJaye,
    What OS and version of FreeHand MX?
    Thanks,
    Sumit Singh

  • IPad 2 Does not retain names and passwords after iOS-upgrade  to 8.0.2

    After the last series of iOS upgrades (device current status is 8.0.2 , latest available) the iPad2-16G WIFI version, does not retain any names and passwords anymore. Function (Safari) is enabled.
    Re-booting, clearing memory etc did not solve anything).
    Is this a known version 8.0 bug or .......?

    Make sure "Private Browsing" is disabled.

  • Home Page does not retain sign-on

    I just recently updated to FF 7.0.1. Since then my Home Page (Google.com) does not retain my sign on even though I have checked the box to remember the sign on information on this computer. It always worked before the update and that is the only thing that was changed. Windows VISTA home premium sp2 operating system. HP Pavilion dv9843cl Notebook PC.

    See:
    * http://kb.mozillazine.org/Preferences_not_saved

  • Iphone calendar does not retain entries after 2 months

    iphione calendar does not retain entries after 2 months

    OMG. I just did that sync thing and IT ALL CAME BACK!!!
    I only hoped it would fix it for future. Wow- where WERE those entries that they could return? Is that the Cloud.
    Thanks.
    Low-tech elder

Maybe you are looking for

  • Conversion from VS2003 to VS2005 Crystal Report View is not compatible

    I am trying to migrate an application from VS2003 to VS2005.  I am trying to run it locally, using the localhost method.  I am getting a parser error: The base class includes the field u2018CrystalReportViewer1u2019 but itu2019s type (CrystalDecision

  • Can't connect to our wifi with my laptop, but pc and iphone can!

    All devices (my boyfriends pc and my iphone and ipad) can log into our new wifi network except for my macbook pro. I can connect to any other wifi like the starbucks or our neighbors network, and all different hotel networks. I've never had a problem

  • How to arrive net price value per unit

    Hi gurus pls help me to arrive NET SALE VALUE PER UNIT MRP PER UNIT using key figures in POSDM and SAP R3. Pls help sure i will assign full points thanks in advance regards rajesh

  • Workprocess in Private Mode

    Hi, In our BI system, we want to avoid that dialog workprocess entering in private mode. Now we have the next situations: Number of dialog workprocess: 30 rdisp/wppriv_max_no: 25 rdisp/max_priv_time: 600 We had thought to change this parameters to: r

  • SAP MDM + SAP CRM

    Hi Experts! I am SAP MDM technical consultant and i want to add something more concrete to my SAP skill set. For that i want to learn SAP CRM.PLease tell me how is SAP MDM+ SAP CRM as a skill set combination as compared to SAP MDM + SAP BI ? Thanks i