Is there any way to get at a result set that only has one entry when using

And please dont tell me its because of the driver... I know this but cant do anything about it
Using Access the only method available is rs.next() and I think that when the statement is prepared it goes to the first (and only) row, so when it executes the cursor is in the wrong place....
Maybe someone could show me some code that stores the rs in somethingI can search through... Theres been some mention of vectors and hashtables but I've not used them (yet)!
String fName = "empty";
String query = "SELECT * FROM Committee WHERE UName LIKE ?";
java.sql.PreparedStatement statement = connection.prepareStatement(query);
statement.setString(1,user);
java.sql.ResultSet rs = statement.executeQuery();
while (rs.next())
fName = rs.getString("FirstName");
out.println("first: " + fName);
This prints nothing
However when I use:
java.sql.Statement statement = connection.createStatement();
java.sql.ResultSet rs = statement.executeQuery(""SELECT * FROM Committee WHERE UName LIKE 'pippip' ";
It does!
The user variable is printed onto the page to test it exists -which it does
And it cant be sending null to the database or else I'd get a null pointer or sql exception...
Its driving me nuts!!!

And please dont tell me its because of the driver... I
know this but cant do anything about it
Using Access the only method available is rs.next()
and I think that when the statement is prepared it
goes to the first (and only) row, so when it executes
the cursor is in the wrong place....
Maybe someone could show me some code that stores the
rs in somethingI can search through... Theres been
some mention of vectors and hashtables but I've not
used them (yet)!
String fName = "empty";
String query = "SELECT * FROM Committee WHERE UName
LIKE ?";
Like is only used when you want to compare approximate values using wild cards.
You however are not using wildcards.
If you want to do an exact match then you should use '='. If you want to approximate matches then you should use a wildcard: '%' or '_'.
java.sql.PreparedStatement statement =
connection.prepareStatement(query);
statement.setString(1,user);
java.sql.ResultSet rs = statement.executeQuery();
while (rs.next())
fName = rs.getString("FirstName");
out.println("first: " + fName);
This prints nothing
However when I use:
java.sql.Statement statement =
connection.createStatement();
java.sql.ResultSet rs =
statement.executeQuery(""SELECT * FROM Committee WHERE
UName LIKE 'pippip' ";
It does!
The user variable is printed onto the page to test it
exists -which it does
And it cant be sending null to the database or else
I'd get a null pointer or sql exception...
Its driving me nuts!!!

Similar Messages

  • Is there any way to get the server app other that through the app store. We do not have our system conneted to a network. I typical downloaded items on a non-apple system.

    is there any way to get the server app other than through the app store. The system that I need it on are not connected to the internet.
    We run a closed-loop network of apple systems and I tipically downloaded updates on a non-apple system that was on the internet.
    Any ideas?

    I did buy the server app, went to the app store to download it. This system I'm using for downloads is Snow Leopard 10.6.8, it shows that I can download it but only as an Install which says I need 10.8. I can't seem to find a way for it to just download as a package or .dmg file so that I can copy it to DVD/CD or flash drive.

  • Is there any way to get the LED light to flash only when an alarm rings?

    I know how to get LED flashing for alerts, but it only works for ALL alerts. I just want LED flashes for alarms that are set through the clock.app. Is there a way that will let me do this?
    I'm using an iPhone 5 with 7.1.2, and will be updating to 8 soon.

    No.

  • Is there any way to get my old iTunes library that is saved on my Spotify into my new iTunes library?

    Best Buy screwed me and lost everything, so since my Spotify was linked through my Facebook when I re-installed Spotify it was all still there. So, I was wondering if there was any way to put my music back into my iTunes library? I tried authorizing it and that didn't help at all. I clearly know nothing about any of this.

    If I understand it correctly Spotify has indexed the media you like, and you can stream it again to the Spotify app on demand within the terms of your subscription. It won't give you access to downloadable copies of your tracks.
    If you have an Apple device see Recover your iTunes library from your iPod or iOS device, otherwise see HT2519: Downloading past purchases from the App Store, iBookstore, and iTunes Store.
    tt2

  • Is there any way to get aperture to include caption and title with a photo when emailing directly from aperture?

    I have been all over and it seems impossible to do... but it also seems impossible that I'm the only one who wants to put a title and description with a photo once, and then have that follow the photo when I email it, rather than having to re-type each little tidbit every single time I email an image. I use aperture for work and am always creating custom batches of images to send to prospective clients. it's crazy having to re-do the information every time.
    Any suggestions for workarounds, plugins... something I'm missing?? iphoto used to do this automatically but it seems it doesn't anymore. even knowing the reason why they aren't allowing it might make me feel less insane
    thanks!

    Thanks both of you!
    I think my iphoto settings must have defaulted back when I migrated to my new computer because sure enough, when I followed your instructions it went back to emailing the descriptions, which is great, and I hadn't ever tried opening the same library in iphoto. That's really convenient. It's too bad (and sort of strange I think) that Aperture doesn't have the same feature but as workarounds go this one is quite lovely.
    The only remaining question is why, when I do open the library in iphoto, the description is intact but there is no title other than the version name?
    For example, in aperture there is the version name, which is something like _DSC1733, the title I added in the "title" bar, which might be "diamond necklace" and then the description which is "18" long, 2carats total weight, platinum, 2013".
    When I open the library in iphoto, the version name is at the top and under it is the decription, and the title is gone.
    Unless there is another button I missed I think I have to go in and add the title into the description, and then just uncheck the version name when emailing so it doesn't show up.
    Any advice? Hope I made the question clear-ish

  • I live outside of the US and I dont have a US credit card but lots of itunes credit. Is there any way to get itunes match or is it only for people with US credit cards

    How do I get I tunes match without a us credit card

    iTunes in the Cloud, iTunes Match, and iTunes Radio availability
    Once you determine if iTM is available in your country of residence then you'll need a credit card drawn on a local bank and an address to subscribe to iTunes Match.

  • HT203167 my computer crashed and lost my itunes, now i have a new computer...is there any way to get my music back from my account

    my computer crashed and lost my itunes, now i have a new computer...is there any way to get my music back from my account

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.
    Use your backup copy to put everything back.
    If for some reason you have failed to backup, not good, then you can redownload some purchases in some countries.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Is there any way to get the height/width of an image before importing it in the indesign document.

    Hi All,
    I need to obtain an image's attributes such as dimensions (height, width in pixels) without placing image in indesign document.
    I have full path of the image (say abc.jpg is stored at c:\my pic\abc.jpg).
    I have obtained the IDFile for this image, tried getting size using GetFileSize() which correctly return size in bytes.
    Is there any way to get the height/width of image without importing it in the indesign document.
    Please, give me some hints. I have spent quite a lot time digging in CHM. I have searched in FileUtils, IDFile API's but found no method which serves this purpose.
    At this point I am clueless where to search next.
    Any help will be appriciated.
    Just a point to mention, I am able to get image height and width for an image in indesign doc though Its not my requirement.
    Thnx,
    D.

    You might be able to examine the contents of the PlaceGun after calling kImportAndLoadPlaceGunCmdBoss without actually placing the image in a document. Not sure, but would be worth looking at.
    Otherwise you will probably have to write platform specific code, ideally with a generic platform-independant wrapper (see SDKSamples/paneltreeview/PlatformFileSystemIterator).
    For the Mac, look at CGImageGetWidth() etc., not sure what the best option is for windows.
    Perhaps Quicktime could provide you with a platform independant solution.

  • Is there any way to get the appStore link for my application

    Hi everyone , i am developing an app which has a feature of sharing its appstore link with the friends through mail,so that they can see my appplication in appstore and buy it directly on click of a button. For that i need to use the app store link of my application for sending it . is there any way to get that and using it dynamically in my app immediately after releasing it.

    Your best bet would be to create a web page of your own for the app. Design that page so that it uses 'META REFRESH' to redirect the visitor straight to the App Store link.
    That way you can hard-wire your own web page address into your app.
    This has the advantage that it can work well even before you've noticed that your app has arrived on the App Store. Create a real web page, describing the app and telling people to search for it in the App Store by name - then replace it with the auto-redirect page when you've discovered your application's App Store address.

  • HT1386 i am trying to restore a backup og my iphone 4 from itunes on my macbook, it asks me for a password which i do not recall setting up, is there any way of getting this password.

    i am trying to restore a backup og my iphone 4 from itunes on my macbook, it asks me for a password which i do not recall setting up, is there any way of getting this password.

    No there's not.  Otherwise that wouldn't be very secure, would it?

  • I had 41 tabs open in about six groups over the last year and a half and I just close them and exited Firefox. Is there any way to get them back?

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/856718]]</blockquote>
    I had 41 tabs open in about six groups over the last year and a half and I just close them and exited Firefox. Is there any way to get them back?
    Also, is there any way to save a group or an open session and then restore it later?

    History menu, if it was destroyed in the last session
    then use "Restore Previous session:" and then restore all windows also from the history menu.
    If done in this session try the restore all windows under the history menu.

  • Federal court website gives a .pl document which opens as garbage until we manually change it to .pdf, is there any way to get Firefox to do this automatically?

    I am using a Mac. When downloading a document from the federal court website using Firefox, we get a .pl document which opens as garbage (in TextEdit) until we manually change it to .pdf, which causes it to open just fine (in Preview). It used to work fine, giving a .pdf document every time, but apparently upgrades to Firefox have removed this functionality. As far as I can tell my computer, an iMac running Mac system OS X 10.10.1, does not recognize the .pl format. Is there any way to get Firefox to automatically convert a downloaded file from .pl format to .pdf format? My friend tells me that Google Chrome downloads these documents with no problem. I would prefer to stick with Firefox but I might have to change if every downloaded document is in an unreadable format.
    This is a typical example of what I get when I try to open a .pl document (the pdf version is a one page document using plain English):
    =====
    %PDF-1.5
    %‚„œ”
    2 0 obj
    <</Length1 15628/Length 10121/Filter/FlateDecode>>stream
    xúÌ{i`U∂9∑™∫;kWoYÈtuöK“ÑR@“ F!,Å$ñêÑÑd Ç䆆¢≤)
    ¢Ääƒet\FeûN࣌∆y3"ÈÔ‹Í|Ûæ˜˝˙˛LUNü{œ›Œ=€=∑i

    HI jlawrence1,
    Is it possible to associated the pl file mimetype with an application? [[Applications panel - Set how Firefox handles different types of files]]

  • Is there any way to get my photos FROM my iPod Touch back onto a new hard drive?

    My Mac crashed last Friday. First timeIs there any way to get my photos FROM my iPod Touch back into my new hard drive. The iTunes sync only goes one way from the computer to the iPod.
    It syncs the photos taken with the iPod (really an old iPhone 3G without phone service) but not the folders which I synced from the old hard drive to the iPod over the past year.

    thank you for the tip.
    Yes, my computer was backed up. for reasons way too complicated to go into here, these particular folders were not part of the backup.
    Thanks again for the help.
    jglaiche

  • Itunes deleted my 30 gigs of music and I didn't have it saved in itunes or on computer, is there any way of getting music back?

    Itunes deleted 30 gigs of music from my ipod. And I don't or didn't have it saved in Itunes or on my computer....is there any way of getting my music back? Alot of the music was not purchased from Itunes....mostly from cds I dont have anymore! PLEASE HELP!

    If the lost music is no longer on your iPod, on your PC, or in another backup somewhere, you are out of luck.  You can download most iTunes purchases again at no cost via iCloud.  See this article for more information and assistance.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    For non-iTunes purchased content, you'll need to redownload or rerip them from their original source.
    B-rock

  • Is there any way of getting back from a wrong clicked free trial to add my serial number correctly?

    Hi
    On purchasing a new imac I copied the apps across & on opening CS6 was requested to load serial numbers, through tiredness I added the seria; number from CS5.5 and therefore not recognised for the CS6, then when about to enter again through tiredness I must have clicked free trial and now have the CS6 in that format.
    Is there any way of getting back to that initial box to load the correct numbers & get out of trial as although it works I need it set up correctly?
    Any help appreciated

    Sorry, cant see this visible on menu or drop downs, did run through all menus before posting, could just be tired from 3 weeks straight.
    If this is not an option does that mean I am set up ?

Maybe you are looking for