Is any way to set up a preparestatement in this situation?

Here are two related tables:
friends (
id varchar(20),
myfriends []varchar(20)
account (
id varchar(20),
name varchar(20)
I need to find out someone's friends' names, if there is any.
Two SQL statements are needed to achieve the result. In order to put both in one single try-catch block, the two statements are as the follows:
String str1="select myfriends from friends where id='" + id + "'";
String str2="select name from account where id = ?";
The problem is the the result of the first statement can vary from empty (easy to handle) to any number. The second statement only deals with one id. Is any way that I can use the format of the second statement to handle with multiple ids? Or I have to use two try-catch block instead?
Thanks for your suggestions.
V.

String str1="select myfriends from friends where id='"
+ id + "'";
String str2="select name from account where id = ?";Not sure I nailed what you are asking, but you might try creating an inlist that dyanmically would look like this:
String str2="select name from account where id in('aa','bb','cc')";

Similar Messages

  • Is there any way to set a timer for particular playlist?

    i would like to listen to a sleep playslist everynight without getting up to turn it on. is there any way to set it in advance?

    this is not the problem. i know how to open iTunes when it starts up and to schedule the computer to shut down. what i want to is at 8 pm close all applications except iTunes, put the display to sleep and at 9 pm start playing a sleep playlist. i have been told many times not to look at the computer an hour before bed and i so i want to avoid having to look at it to start my go to sleep playlist.
    i have looked at a number of programs but i don’t see one that does this yet.

  • My wife and I share an iTunes account. Is there any way to set up a seperate one for her to sync her phone contacts, iCloud and music to without having to purchase all her music again and then share going forward?

    My wife and I share an iTunes account. Is there any way to set up a seperate one for her to sync her phone contacts, iCloud and music to without having to purchase all her music again and then share going forward?
    It would be so much easier having seperate accounts but we have hundreds of her purchased songs on my account and she would need to be able to access these from her account. Possible?
    Also, if we bought a song in future we would want to be able to both have access to it.
    Alternatively, what is the easy way to sync two distinctly different contact lists to one iTunes account?
    Thank you in advance.

    FYI: iTunes account (used to make purchases) is not the same as iTunes library (iTunes on your computer with music, movies, etc.).
    ecbclb wrote:
    Will we have to create a seperate account for her, or can we all have the same one?
    You can but you will not be able to limit what she syncs.
    I would like to avoid 'checking' and 'unchecking' individual songs every time one of us tries to synch our ipods to the library.
    I don't recommend using (only) the checkmarks to select what to sync.
    Each of you can create your own playlists then sync only those playlists.
    Then add/delete from your own playlists to change iPod content.
    The only time I uncheck items is if I rarely/never want to sync them to anything, such as Christmas music or old audiobooks.
    I suggest you each have your own computer login account. Then everyone has their own contacts, calendars, and everything else.
    You and your husband can share an iTunes library and let your daughter have her own.

  • Is there any way to set default column widths in the Finder's Column view

    When my Finder windows open in column view, all the columns are always VERY wide. I have to then spend time resizing them to a managable width. Is there any way to set default column widths in the Finder's Column view?
    <Re-Titled By Host>

    No, because you can't set a columns view default.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • I just got my daughter a new macbook pro. She currently shares my wires apple id for iTunes on her iTouch. I need to set up an email account for her. Is there any way to set up a new iCloud email account but still use my wires apple id for iTunes?

    I just got my daughter a new macbook pro. She currently shares my wifes apple id for iTunes on her iTouch. I need to set up an email account for her. Is there any way to set up a new iCloud email account but still use my wifes apple id for iTunes?

    No it's not stealing. They have an allowance that you can share with so many computers/devices. You'll have to authorize her computer to play/use anything bought on your acct. You can do this under the Store menu at top when iTunes is open on her computer.
    As far as getting it all on her computer....I think but I am not sure (because I don't use the feature) but I think if you turn on Home Sharing in iTunes it may copy the music to her computer. I don't know maybe it just streams it. If nothing else you can sign into your acct on her computer and download it all to her computer from the cloud. Not sure exactly how to go about that, I haven't had to do that yet. I wonder if once you authorize her computer and then set it up for automatic downloads (under Edit>Preferences>Store) if everything would download. Sorry I'm not much help on that.

  • Is there any way to set a password so that txt messages only open when the password is entered

    Is there any way to set a password so that txt messages only open when the password is entered?
    Please help! Thanks for reading:)

    Hello Damien,
    There is an option to set a passcode for the entire iPhone.  You can use the following steps to set this up:
    You can configure a passcode for your iPhone, iPad, or iPod touch using Settings > General > Passcode Lock.
    Once enabled, you will be prompted for the passcode whenever you:
    Turn on or restart the device
    Wake the device
    Unlock the screen
    Note: You can specify the amount of time the screen must be locked before requiring a passcode.
    You can find the full article here:
    iOS: Understanding passcodes
    http://support.apple.com/kb/ht4113
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Any way to set global variables except EAS console?

    Hi pros,
    I am searching for a way to set global variables (used by business rules) automatically.
    I got several variables which should change each month. I know the rule to set them.
    However, I cannot find any way to set them through scripting or something else.
    I tried to research EAS repository. The one that I found relevant is HBRVariables table.
    I cannot find any tool can help this.
    Any one knows how?
    Appreciated......
    Casp Huang

    Yes you can use substitution variables in business rules and they are widely used, it is relatively easy to automate the changing of values for subtitution values.
    You can also put a sub var into the default value for a global variable in business rules.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Any way to set snooze time on the Alarm Clock

    The default snooze time on the Alarm Clock is 10 minutes. Any way to set it to 5 minutes?

    No, but there's and App for That.  Try Garage Bank for iPad in the App Store.

  • Is there any way to set up icloud with Windows XP?

    Is there any way to set up icloud using a PC with windows XP?

    Yes there is.
    There are many threads on this forum discussing this issue already (it's good to search before asking the same quesiton again).
    There is a simple hack to get iCloud control panel to work on Windows XP to give you synced access to Contacts, Calenders, Reminders and Bookmarks. It also can be used to set up your me.com mail. Photostream doesn't work.
    I found a solution here, have written it up in clearer english and added details re IMAP support for me.com addresses here:
    http://xlii.be/s/1ii
    In summary:
    You need:
    Unpacking program e.g. 7-Zip or WinRar
    Orca MSI editor
    The iCloud setup hack for Windows XP:
    Download iCloud Control Panel for Windows.
    Open iCloudSetup.exe file with WinRar or 7-Zip and extract.
    Navigate to and open the iCloud.msi or iCloud64.msi (for 64bit systems) with Orca.
    In the left table select LaunchCondition. Then change in the right table “VersionNT> = 600” to “VersionNT> = 200” and Save.
    Run modified iCloud.msi and install.
    Run iCloud Control Panel, located in the Windows Control Panel, and set up as you want.
    I've had reports that you need to keep the files extracted from the .exe file in the same directory during installaton of the .msi file.
    Have fun!

  • Is any way to set up the store or computer to download only the cc version not the HD when you buy a movie?

    Is any way to set up the store or computer to download only the cc version not the HD when you buy a movie?

    every time that I download a movie in I tunes it downloaded the two version CC and HD, so it takes a long time for the HD. how can I stop or only download the CC version?

  • HT1688 Is there any way to set password to protect the location service, to keep GPS open? so, the theft cannot turn it off so easy, because once the location service is turn off, all GPS track is useless...

    Is there any way to set password to protect the location service, to keep GPS open? so, the theft cannot turn it off so easy, because once the location service is turn off, all GPS track is useless...

    That is what Activation Lock of iOS 7 does
    In addition, it renders the iPhone totally useless to anyone who doesn't know your Apple ID and password.
    Allan

  • Is there any way to set the height of choice list or list of values?

    Hello Everyone,
    (Jdeveloper: 11.1.2.1.0)
    I recently created a page with some fields as choice lists and some as list of values. Somehow the choice list when opened it is not displaying data properly (I have 3 rows, it is showing only 2 rows and have to scroll to see third row) . I would like to see if there is any way to set this so that I can see all three rows or set the height of choice list as a fixed height?
    Thanks,
    Ravi Nuka.

    Hi Manish,
    sorry for the delay, here the code for the list binding from vo.xml
      <ListBinding
        Name="LOV_SetOfBooks"
        ListVOName="NfSetOfBooksRVO1"
        ListRangeSize="-1"
        NullValueFlag="none"
        MRUCount="0"
        ComboRowCountHint="10">
        <AttrArray Name="AttrNames">
          <Item Value="SetOfBooks"/>
        </AttrArray>
        <AttrArray Name="ListAttrNames">
          <Item Value="SetOfBooksName"/>
        </AttrArray>
        <AttrArray Name="ListDisplayAttrNames">
          <Item Value="SetOfBooksName"/>
        </AttrArray>
        <DisplayCriteria/>
      </ListBinding>
    <ViewAttribute
        Name="SetOfBooks"
        PrecisionRule="true"
        EntityAttrName="SetOfBooks"
        EntityUsage="EdContractsEO"
        AliasName="SET_OF_BOOKS"
        LOVName="LOV_SetOfBooks">
        <Properties>
          <SchemaBasedProperties>
            <DISPLAYWIDTH
              Value="30"/>
            <CONTROLTYPE
              Value="combo_lov"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>Thanks,
    Ravi Nuka

  • Hi guys. Just a quick question. My wife has a Mac Book Pro and when she is browsing the web she can use a two fingered gesture to go back to her previous page (by swiping from right to left). Is there any way to set that up on my iPad Mini. Many thanks.

    Hi guys. Just a quick question. My wife has a Mac Book Pro and when she is browsing the web she can use a two fingered gesture to go back to her previous page (by swiping from right to left). Is there any way to set that up on my iPad Mini. Many thanks.

    Not in the Safari browser she can't. That is not supported on the iPad. There are other mobile browsers that do have that functionality - one is iCab Mobile.
    https://itunes.apple.com/us/app/icab-mobile-web-browser/id308111628?mt=8

  • Using the Motorola Atrix w/ the laptop dock, when I open a web page with Firefox I have to hit "Ctl +" three times to make the page fill the screen. Is there any way to set up so pages open the right size?

    I'm using the Motorola Atrix smart phone with the Laptop Dock. When I open a web page with Firefox I have to hit "Ctl +" three times to make the page fill the screen. Is there any way to set up the Firefox browser to open the web pages the right size in the first place?

    The Firefox Page Zoom feature does a domain by domain level of saving the users preferred zoom level settings, there is no default Page Zoom level setting in Firefox.
    Try the Default FullZoom Level extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/6965
    Or the NoSquint extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/2592/

  • Is there any way to set the SCCM system to use local time instead of UTC?

    We have ConfigMgr 2012 in our environment. We are in EST.
    Is there any way to set the SCCM system to use local time instead of UTC?
    When we try to deploy packages, if you don’t specify the time, it reverts to UTC which for us is off by 5 hours.

    Which times are you talking about? Deployment start times or deadlines? Those could be set to UTC *or* client local time.
    Torsten Meringer | http://www.mssccmfaq.de

Maybe you are looking for

  • From MSS Requisition request is not coming in Recruter UWL.

    hello everyone, we are creating Requisition request in MSS. But Request is not reaching Recruter UWL. We tried to find so many ways to solve this problem. We got to know that there is problem in workflow. we are getting follwoing error. Object CL_HRA

  • Two ipods on one account - how do i intro new one?

    i just bought a new 30GB and tried updating it using my existing itunes, which supports a 1 generation ipod. now my new ipod just shows a folder with an ! mark. how do i make my new one work? any help would be much appreciated.

  • [WORKED-AROUND]video files not playing

    Hi archers, upgraded my system today & now it refuses to play video files in vlc I get the following output: VLC media player 2.1.5 Rincewind (revision 2.1.4-49-gdab6cb5) [0x8541f8] main libvlc: Running vlc with the default interface. Use 'cvlc' to u

  • New 8820 email issue

    I have a new 8820, upgraded from a previous blackberry.  How do I apply the same blackberry email address to forward to my handheld.  I can't seem to find an option to use an exisiting blackberry.net email account.

  • Applets will not run on Win2k

    Hello all, thanks for reading. I have searched the Internet, this forum, and I am at the end of my wits. I have workstations that must run Java applets for specific sales training. Several workstations will not run applets at all, and only get the re