This is a quick but v.important question.

hi,
i have a thread thats part of a class that implements runnable (class b)
in it's run method it executes code that retrieves values in a database and stores it in a string array.
i need to pass this array to the caller class a.
how can this be done???
i know of using a set method to set the array in class b, but how could it be returned to class a, as i would have to pass a parameter to it, as this would be how it is set in class b.
this is very urgent, please help

public class PrimaryKeysFinder implements Runnable
    Vector cache;
    Connection dbconn;
    Statement stmt;
    String query = "select table_name, constraint_name from user_constraints  where constraint_type = 'P'";
     public PrimaryKeysFinder(Connection dbconn)
          this.dbconn = dbconn;
          Thread runner = new Thread(this);
          runner.start();
     public void retrievePrimaryKeyInfo()
                         cache = new Vector();
      try{
               stmt = dbconn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
               ResultSet rs = stmt.executeQuery(query);
               int columnCount = 2;
             int count = 0;
               while(rs.next())
                    String[] records = new String[columnCount];
                    for(int i = 1; i <= columnCount; i++)
                         records[i] = rs.getString(i);
                        cache.addElement(records);
           catch(Exception e)
                JOptionPane.showMessageDialog(null, "Error retrieving primary key info");
                 cache = new Vector();
     public void run()
          retrievePrimaryKeyInfo();
     public Vector getPrimaryKeyVector()
          return cache;
}but since cache is a global variable whatever i do to it in the method retrieveprimarykeyinfo wont matter as when getPrimaryKeyVector is invoked it returns the inital value of vector as null, not as what it's assigned in the method retrieveprimarykeyinfo.
thanks for the prompt reply

Similar Messages

  • This is semi-unrelated but.. (keyboard question)

    external keyboard to be specific so I guess it's still considered "expanding"
    Well, I knew from the start when I got my MBP that I wanted an external moue and keyboard and to ultimately use this as my desktop computer with an external display also.
    But........
    Does Apple have/will come out with the new aluminum keyboard with the number pad and make it wireless? I only see the wired one with the number pad as of now.
    All help's appreciated .

    Only Apple knows what future products it will make. We have no idea what will be until Apple releases the product.
    FWIW, you've posted this question in the wrong forum. There are separate MacBook Pro forums. This is a Mac Pro forum.

  • This doesn't fit, but I have questions New MACBOOK pro 15 inch

    I am going to get the new Macbook Pro 15inch. I want the 2.8Ghz and I will build up the RAM later. Anyway, for the money should I go the 3.0 GHz? I am a video editor that works on SD and HD, usually never over 720p. I also do a little work in AE, I make my titles and some low level graphics. Will there be a big difference for me in 2.2Ghz of chip power, or can will I be fine for a while with the 2.8.
    I know the MAC isn't out yet, but I am trying to save some money. It beats the old price of the mac daddy 15 inch that was topping out at 2300 bucks.
    Cheers.

    The 2.8Ghz should work fine. I don't think you would notice that much difference going to the 3.0Ghz. Get a large/fast HD though for video. I just put a 500GB 7200RPM in my aluminum MBP. The 250GB 7200RPM stock drive outgrew me fast.
    Dave M.
    MacOSG Founder/Ambassador  An Apple User Group  iTunes: MacOSG Podcast
    Creator of 'Mac611 - Mobile Mac Support' (designed exclusively for an iPhone/iPod touch)

  • I currently have a 1Tb HDD installed in my macbook pro and have just recently acquired a 120GB SSD. I want to put the operating system on the SSD so it boots quickly but keep the files on the HDD. How do I do this?

    I currently have a 1Tb HDD installed in my macbook pro and have just recently acquired a 120GB SSD. I want to put the operating system on the SSD so it boots quickly but keep the files on the HDD. How do I do this?

    i also contacted the company that sold me the battery and they offered me my money back or a new battery
    Suggest that you take them up on their offer of a new battery.  Make sure you got the right one for your model MBP. 
    2 separate MBP battery installation Articles:
    1 -
    MacBook Pro: How to remove or install the battery
    2 -
    MacBook Pro: How to remove or install memory
    =================
    Never post your email address in a public forum.  Spam bots roam public forums looking for "spam victims". 
    If you insist on using your email address in a public forum & you want to "trick" the spam bots, then suggest that instead of using "@" in the email address, use instead the actual word AT.
    Regarding responding to your emal addy, we ask that you post all questions to the appropriate discussion forum. This allows other users and other helpers to have a chance to view and respond to your post. That way, everyone benefits from the exchange.
    Thank you
    I have requested that a HOST remove your email addy.

  • Hi sorry but i have an important question?i have an iphone 4 and i want connect his to i tunes in a second pc because the pc i connect before is broke..how can i do?without lost my photo number or music?

    hi sorry but i have an important question?i have an iphone 4 and i want connect his to i tunes in a second pc because the pc i connect before is broke..how can i do?without lost my photo number or music?

    check out this post by Zevoneer.

  • This is a weird start to my question; but i went to a music festival today and I was in a mosh pit and it was hot, and my iPhone 4 turned off and I was wondering weather it was from the heat or something else? And what I could do to fix it? Thankyou :)

    this is a weird start to my question; but i went to a music festival today and I was in a mosh pit and it was hot, and my iPhone 4 turned off and I was wondering weather it was from the heat or something else? And what I could do to fix it? Thankyou

    okay, thankyou for you help anyway 

  • I tried to import a PDF of a line drawing into Photoshop Elements. The thumbnail looks fine, but when imported the file is empty. This used to work in the past. What is wrong and how do I solve this?

    I tried to import a PDF of a line drawing into Photoshop Elements. The thumbnail looks fine, but when imported the file is empty. This used to work in the past. What is wrong and how do I solve this?

    Hi
    The value of the Channel Strip volume etc is not stored within the C Strip setting, as you have discovered.
    If you really wanted, you could add a Gain plug to the strip, with it set to give the correct output level with the Fader set to 0
    (Or just set the fader manually in MS)
    CCT

  • TS1277 it says apple mobile device fails to start i do not have sufficient priveledges..... this was after i updated my i tunes so i unistalled i tunes and reinstalled but the same question  persists

    it says apple mobile device fails to start i do not have sufficient priveledges..... this was after i updated my i tunes so i unistalled i tunes and reinstalled but the same question  persists

    Hi annibu757,
    If you are having issues with iTunes after an attempted update, you may find the following article helpful:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Regards,
    - Brenden

  • I use a mac ios and shoot raw in a cannon 5d mark ii and shortly upon import of my images lightroom darkens and changes my images. This has happened before but not every time. The strange part is my last shoot had the same camera setting but this did not

    I use a mac ios and shoot raw in a cannon 5d mark ii and shortly upon import of my images lightroom darkens and changes my images. This has happened before but not every time. The strange part is my last shoot had the same camera setting but this did not happen. The images i have now i can not use after lightroom has automatically altered them even if i try editing back to how they looked upon import

    First thing to do is to change the default camera profile applied in Lightroom to camera standard (assuming that you shoot Canon or Nikon). Also make sure that your camera is NOT set up to use any of the HDR modes. Nikon calls those Active Dynamic Lighting. On Canons you often see things like highlight priority mode or "Auto Lighting Optimizer". Make sure that the picture style is set to standard and that for newer Canons the HDR mode is turned off. Most of the HDR modes simply underexpose the image and then add an instruction in the raw file to compensate for this to prevent highlights from being blown out. This causes more noise in the shadows and if you know what you are doing there is no point to this as you should simply expose correctly and get the highest quality raw.
    Lastly, make sure that in Lightroom you have not checked "Apply Auto Tone Adjustments" in Preferences->Presets. This should make the default rendering of the raw files the same as the in-camera jpeg (what the camera shows on the back even if you shoot raw) but still give you all the latitude of raw files.

  • I do not manage to find the function to change a letter into exposing. I have MUSE DC 2014.2 and the menu does not display this possibility. I tried to import it IN design but that does not function either?

    I do not manage to find the function to change a letter into exposing. I have MUSE DC 2014.2 and the menu does not display this possibility. I tried to import it IN design but that does not function either?

    I'm not clear on exactly what it is you're asking, but if you're referring to changing opacity, you can change the opacity setting for the States of a menu item via the States panel and Control Strip.

  • Ok, tried message boards everywhere to try and figure this out before having to post a question. Have a 21.5" iMac running Snow Leopard 10.6.8.  After updates no wireless capability for ipad or laptop, imac connects fine but nothing else.No widgets work.

    Ok, tried message boards everywhere to try and figure this out before having to post a question. Have a 21.5" iMac running Snow Leopard 10.6.8.  After updates no wireless capability for ipad or laptop, imac connects fine but nothing else. No dashboard widgets work, Skype won't work. What goes?

    Your post is pretty lengthy and I have to admit I didn't read it all. Please try restarting in Safe Mode, if that doesn't work please do both a SMC and PRAM reset. These may take 2-3 attempts.
    SMC RESET
    Shut down the computer.
    Unplug the computer's power cord and all peripherals.
    Press and hold the power button for 5 seconds.
    Release the power button.
    Attach the computers power cable.
    Press the power button to turn on the computer.
    PRAM RESET
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • Deafult search engine on a new tab-this thread was closed but I have a related question. Once you put the new url in, what then? Close? When tried, did not work

    "deafult search engine on a new tab" - this thread was closed but I have a related question. [the word “default” is spelled as it on the thread] Once you put the new url in, what then? Close it? When tried, it did not work. The closest answer is noted here. Instructing to go to about:fig. Specifically, I installed the accuweather add=on and it took over my tab home page - the one that comes up when you click for a new tab. I didn't like it so I clicked the button to remove it and the page went blank. I searched to see out to restore the tab page, tired the reply at this page :
    http://support.mozilla.org/en-US/questions/753256?s=install+search+box+on+new+tabs&r=3&as=s
    But it did not work. Can some on help me? Just want to know how to make google or some page open on a new tab.
    Many thanks

    Thanks so much for your support. As I said I am not a professional, so I by chance saw a friend who is and this is what he suggested and it worked.
    We googled for an answer and found this site: http://www.guidingtech.com/8004/have-new-tab-page-open-specific-website-firefox-chrome/
    It says to Download and install Download and install''' NewTabURL''' and gives instructions on how to. Now when I open the tab it goes to my preferred search page!

  • Able to import track names quickly but unable to import music from CD

    When I try to import a music CD The tracks are imported quickly but no music is imported. When I try to play the tracks the speaker icon moves rapidly from one song to the next without playing. When I go to my library and try to play a song from the CD it randomly plays a song from my library. I have sucessfully transfered my library from my old XP computer to my new Vista computer and initally had no problems. I believe the problem started when I updated iTunes, now 7.6. I have been on the forum for hours and have seen several other postings with the same problem but no solutions. Please help.

    When I try to import a music CD The tracks are imported quickly but no music is imported. When I try to play the tracks the speaker icon moves rapidly from one song to the next without playing. When I go to my library and try to play a song from the CD it randomly plays a song from my library. I have sucessfully transfered my library from my old XP computer to my new Vista computer and initally had no problems. I believe the problem started when I updated iTunes, now 7.6. I have been on the forum for hours and have seen several other postings with the same problem but no solutions. Please help.

  • HT1420 unable to import apps getting this computer not authorized, but music etc. will import

    unable to import apps getting this computer not authorized, but music etc. will import

    cougar78 wrote:
    With me it transferred everything but music and videos. Also it required me to enter my email passwords again (I have several accounts setup). Every time I went to the music tab, it said it couldn't find the file with the name of my 3gs phone name. So now after it installed every app it had stored in my itunes (many I deleted off the phone), I am trying to start fresh and see if I can just add movies and music manually and be glad contacts, email accounts (sans passwords), and the other settings did carry over.
    Were any of those email accounts POP email accounts?? I don't think emails that are locally stored on the iphone are saved when you backup.

  • HT4972 hi one of the main important questions which this site didnt answer to it is: whats the latest version of ios which any device work with it for example i have a ipad 1st and i dont know whats is the latest version of ios for this device thanks

    hi one of the main important questions which this site didnt answer to it is: whats the latest version of ios which any device work with it. for example i have a ipad 1st and i dont know whats is the latest version of ios for this device

    Google "iOS versions" and read the first match (Wikipedia)........

Maybe you are looking for