ResultSet - Can I use one for storing another RS?

I'm wondering wheter or not I can create a ResultSet object (rs3) to store my Resultset rows from a query (rs1) while I'm checking the contents of it (rs1) compared to the contents of another Resultset (rs2)?
Like this:
I have two DB's that I'm querying in the same way (I give them the same question). The answeres aren't the same, and they shouldn't be either (the resultsets aren't the same from DB1 (rs1) and DB2 (rs2)).
A similar thing illustrated in pseudo code:
I compare the two resultsets in a specific column (rs.getSTring("phoneNo")).
Then I compare
if rs1.phoneNo.equals(rs2.phoneNo)
print rs1
else
rs3.add(rs1); // This is where I have problems, is this possible?
So I guess the question is; Can I store rows from a resultset in a new (That's NOT created for a query) resultset and then later use these and still get all the information out of it?
I apprechiate any help or thoughts on this.
Elin

A ResultSet is not a set of results as the name suggests. A ResultSet only stores one row at a time and can get the next value as required. In this it is similar to an Iterator.
If you want to store a ResultSet, use a collection such as a LinkedHashMap() where the key is the primary unique key and the values are the values for a given row.

Similar Messages

  • Can i use singleton for storing current login id

    hello,
    can i use a singleton for storing login userid temporarilary for application lifetime. Is there any issue if more than 2 users login at the same time as the singleton object will be static ! ..

    let me ask more precisely..
    is there anything of concern if i run my program(involving statics) by 2 jvm instances.
    public class Demo extends Thread
         static String[] myargs ;
         public static void main(String args[])
              myargs = args;     
              try
                   Demo.sleep(5000);
              catch(InterruptedException e)
              System.out.println(myargs[0]);
    }look at the pre code...what if i try to run it by using 2 command promptS
    giving different aruements (a bit quick)
    Edited by: rajat on Dec 28, 2007 7:14 AM

  • I was able to use one of my itunes songs for my ringtone but can I use one for my text tone?

    I was able to use one of my itune songs for a ringtone but I'd like to use one of my own songs for a text tone.  Is that possible?

    Welcome to the Apple Community.
    Enter the details of her second account at system preferences> mail, contacts & calendars.

  • How can I use JDesktopPane for storing components?

    Hi there!
    I want to write an app which uses JNI, but I need to store widgets into the JDesktopPane , so that this Pane is always visible, not minimazable and has no decoration.
    Is this possible at all, because as far as I know .add(Component c) only adds new JInternalFrames?
    Or is this possible with an JInternal Frame to use all the space, being always in background and to have no Windows-Decorations (above the JInternal Frame)
    I hope you can help my,thanks for reading!
    Mfg Clemens

    Why do you need to use a JDesktopPane? If all you want is a pane with components on (no menu bar, title bar etc) then you can use a JWindow.
    N35Sy

  • Do I have to have an apple USB power adapter to charge the ipod or can i use one for a htc phone?

    Must I have an Apple USB power adaptor to charge an ipod or can I use the power adaptor from my htc cell phone?

    Read the cell phone user manual to see if the charger can charge an iPod Nano. 
    FYI the usb power charger (AC) does not have to come from Apple.  I purchased mine from Macmall.com

  • How can i use one dtd inside another dtd

    Hello friends,
    I have read some where that one DTD can be imported into another DTD but idont remember how to do it.
    My question is suppose we have a DTD say xyz.dtd and i am writing a new DTD say abc.dtd, and lets assume that in abc.dtd i have to declare some of the elements of xyz.dtd, so iwant to import xyz.dtd into abc.dtd.
    Can anybody please give me a solution for this.
    Thank you,
    sridhar.

    something similar to this.
    // This is abc.dtd
    <!ELEMENT MESSAGE_NODE (MSGHEADER, MESSAGEBODY)>
    // Include the DTD for the Message Header
    <!ENTITY % MSGHEADER SYSTEM "xyz.dtd">
    %MSGHEADER;

  • HT204053 Can I use one Apple ID for two Apple IPhones?

    Can I use one Apple ID for two Apple IPhones? I received an answer of yes.
    Now another question.  I have one ICloud Account, Two IPhones.  Can I use Find my IPhone via the one ICloud Account?  Can I see two IPhones on the map at the same time?  or do I need to view the second phone via some other method.
    Message was edited by: Hunter3D

    Yes.
    Cheers,
    GB

  • Can i use one JSF component's value for other component in the same page.

    Can i use one JSF component's value for other component in the same page.
    For example
    I have a <h:selectBooleanCheckbox id="myChk"> in my jsf page, i want to access its value for another component like:
    <h:commandButton disabled="#{myChk.checked}" action="myAction" value="myValue" />
    ** "myChk.checked" >> I am just asuming "checked" property is available...

    Bind the checkbox to a UIInput myChk property. Then you can reference this property from the page, e.g.
    <h:selectBooleanCheckbox binding="#{myBean.myChk}" onchange="submit();" />
    <h:commandButton disabled="#{myBean.myChk.value}" action="myAction" value="myValue" />

  • Can I use one account for both my labtop and my ho...

    can I use one account for both my labtop and my home computer?
    Solved!
    Go to Solution.

    Softthunder wrote:
    can I use one account for both my labtop and my home computer?
    Hello,
    Yes you can. You can access your account using any Skype enabled computer/device in any country worldwide.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • HT204053 Dear Support Team, every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud???

    Dear Support Team,
    Every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud?
    Thanks

    It is not possible to create a new iCloud account using a Windows machine. You must create the account using a Mac (10.7.5 or more) or an IOS device (iPhone etc). Once that is done you can sign into and use the account on your Windows machine.

  • HT2589 We have purchase 5 apple minis and would like them all on one account.  That way we can monitor the use of these units.  they will be used strickly for a business application.  can I use one account in itunes or must i have multiple.

    We have purchased 5 apple minis and would like them all on one account, that way we can monitor the use of these units.  They will be used strickly for a business application.  Can I use one account in itunes or must i have multiple.

    Not going to happen the way you want it to.
    When you add a gift card balance to the Apple ID, it's available for the Apple ID.
    Probably best to create unique Apple ID's for each... this will also make things easier in the future as purchases are eternally tied to the Apple ID they were purchased with.

  • HT4436 My family has multiple iPhones.  Can we use one Apple ID for all of our phones?

    My family has multiple iPhones.  Can we use one Apple ID for all of our phones?

    If you use the same AppleID for iMessage and iCloud though, you will all be sharing the same message account and iCloud email account.  You can use a common AppleID for purchased content, but each create your own unique AppleID for iMessage and iCloud so you each have your own private accounts for those services.

  • Can I use one itunes account for multiple users and multiple devices

    Can I use one itunes account for multiple users and multiple devices?

    The iTunes EULA, as I understand it (I'm not an attorney )for Apps is basically that one person can use an App multiple devices, or multiple people can use an App one device..so one to many or many to one, but not many to many....

  • I have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    i have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    Chris, I believe this link may have the information you're looking for. Welcome to discussions!
    http://docs.info.apple.com/article.html?artnum=300432

  • New to LABVIEW. How can I use one analog channel to trigger acquisiton of a signal on another analog channel?

    I am new to using Labview and have been tasked to write data acqusition program for my company. We are attempting to log 6 machines, each with their own asynchronous trigger (I can't use one trigger for all 6 machines). I have the idea to use (for example) ai0 for the measurement and ai1 for the trigger (for one machine), yet I see nothing in the documentation on how this is done. I have tried playing around with the DAQ express VI (I am using Labview7) but still don't see a way to have the setup I am looking for. I'm sure this is a relatively easy question, but I'm unsure where to go to look for an answer. Any helpful pointers or guidance in the right direction
    would be very helpful!

    If what you want to do is start the acquisition of channel 0 when channel 1 reaches the trigger condition and not start channel 2 until channel 3 reaches it's trigger condition, then no, you cna't do that unless you have multiple daq devices. What can be easily done is continuously acquire all channels and monitor your trigger channels. When the trigger condition is met, then perform the analysis/logging. On the Analyze>Waveform Monitoring palette is the Basic Level Trigger Detection function. Use one for each trigger channel and have it return either the index or relative time of the trigger occurance. This value can then be used to idex that portion of the measurement channel that you're interested in.

Maybe you are looking for