can you tell me why it is returning false?

the following code works how ever always returns false. so can you tell me why? and what do I do to fix it?
 public boolean checkUser(String user, String password){
        boolean connected = false;
        try{
           Class.forName("com.mysql.jdbc.Driver").newInstance();
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost/finalprojects", "root", "password");
           Statement st = con.createStatement();
           ResultSet rs = st.executeQuery("select * from users where user ='" + user + "' and password ='" + password +"';");
           connected = true;
           rs.close();
           st.close();
           return connected;
        }catch(Exception e){
            e.printStackTrace();
        }

        return connected;
    }

There is no need of the fi (RS. Next here. Execution of select count() will always return a line.

Tags: Java

Similar Questions

  • can you tell me why the mouse on my laptop has stopped working?

    Can you tell me why my mouse stopped working and how to make it work again. Thank you

    If it is the synaptics mouse device you have installed there are a lot of questions similar to yours... I had a wireless mouse at the end of the account and use that now that I could not fix the problem... but... you accidentally pressed the FN and F7 as that often disables the device! (depending on the machine)

    Go to the hardware and peripheral control panel... and you should see several options under devices and printers... mouse option should be there... enter this option and see if you can solve the problem... good luck.

  • Can you tell me why I'm received not allowed to modify a pdf file when I file creater?  I received the question as surity?

    cantrxoraqi9 you tell me why I'm received not allowed to modify a pdf file when I file creater?  I received the question as surity?

    
    

    If a form has been made with LiveCycle Designer, it can only be edited in LiveCycle Designer. This is a permanent restriction, there is no course Acrobat. It is not a security problem.

    LiveCycle Designer forms cannot be made available as far as I know (but I could be wrong here).

    If repeat you a similar content to PDF format, there is no way to reintegrate into the designer. You cannot mix the tools in this way. It is possible in LiveCycle Designer, or it is not possible at all.

  • can you tell me why my pc is overheating and I can fix it

    my pc keeps over heating when it was on about an hour or so can you help me with this or tell me what is the cause of fire

    Could just be a fan blocked upward. Get an air-in-a-can, Staples, Office Depot, etc. and blow out the fan. Do inside the tower as well as the outside. You can do this outside.

  • my touch screen does not work can you tell me why

    I computer.but full-screen sony now my touch screen will not the work.can you help me.

    Hello

    You must check with the support of Sony, their online documentation and drivers, diagnostics and ask
    forums about known problems.

    Sony - Contacts
    http://eSupport.Sony.com/us/Perl/contact-land.pl

    Sony - drivers
    http://eSupport.Sony.com/Perl/select-System.pl

    Sony - Support
    http://eSupport.Sony.com/

    Sony - Forum
    https://Forum.sel.Sony.com/?XID=M:Showcase:eSupport

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • 13 and 14 Firefox installs incorrectly on my windows 7 starter edition. Also, I can not the Scrapbook addon to work. Can you tell me why?

    I tried to install Firefox 13 and 14 on my netbook, a starter for Windows 7 operating system running. The installation starts to go smoothly since the file setup.exe; but after the installation appears to be complete, and I press the button "Open Firefox" program of firefox can be seen to start opening because it accumulates approximately 50 MB of private bytes RAM on the windows task manager or the service program of "process explorer" from sysinternals. However, the firefox window never opens and so firefox does not appear to be installed properly. "" Also I had problems with getting the album ' addon to install properly. " I have another computer, a laptop, XP family and I can get Firefox to 13 or 14 to install but it is on the other computer that I can't get the 'Scrapook' addon to install correctly. There is no notice on the Addon page saying the addon "Scrapbook" does not work on Firefox 13 or 14 and the addon installs, but not properly, so it does not work.

    I have old files Firefox setup.exe, and if I'm successful to install an older version, firefox 3 or 4 on an external hard drive. I got this old firefox to work on XP Home Edition on a hard drive external laptop and can successfully use the addon "Scrapbook" in this way.

    I don't understand why I have problems with Firefox 13 or 14. I think I first noticed the problem with Firefox 12 "Scrapbook".

    Thank you marcsances for your reply very comprehensive. Your advice jogging my memory, so before I have done as you suggest, I reinstalled Firefox 14 and then uninstalled using the windows 7 program/control panel uninstall installation. In doing so, the Firefox uninstall window opens and when asked to choose to uninstall any program or all personal settings etc. too, choose to uninstall all personal settings too. I then reinstalled Firefox 14 and the Scrapbook addon and they now work correctly.

    I daresay that your instructions are quite right, in this case, I don't have to go through the command prompt.

    Thank you.

  • When I receive an email that's left in my Inbox for a minute and move to the pop can you tell me why.

    Why when I get an email there go on pop and don't stay in my Inbox. all my mail will remain in the pop and the Inbox will remain empty. can someone please.

    Version of Windows? What e-mail program you want the message to go and stay in? Will what e-mail program after downloading? Be more specific.

  • I have Firefox 24.0 installed, which is the latest version. Can you tell me why my McAfee Site Advisor has stopped working?

    Here's the answer:

    I just got the phone with McAfee Technical Support is turned off and since a few minutes ago, McAfee Site Advisor is NOT supported on newer versions of Firefox, IE or Google Chrome!

    I was told that if I wanted Site Advisor to work I needed to go back and reinstall and use an older version for each browser.

    I just got a call from McAfee Site Advisor monitoring works now with Firefox & Google Chrome, and not in IE... that doesn't matter to me because I use NEVER IE!

  • Can you tell me why the attached file is so large and incompressible?

    test.jpg

    Even if the maximum compression rate gives approximately 320 kB.

    The file contains a part of JPEG image, with a value of approximately 2 KB to 7 KB, as it has comme l' a conclu found save for Web.

    It does not contain a color profile but much metadata XML, which seems to be responsible for

    for the size. Opening by bridge as ACR does not specific information, with the exception of

    a camera profile. I don't know if it's relevant or only a placeholder.

    Cordially - Gernot Hoffmann

  • I played "Mahjong Trails" and in position # 3. He played last night and I just tried a few moments ago and I come in. Can you tell why?

    Hello

    I played "Mahjong Trails" and in position # 3. He played last night and I just tried a few moments ago and I come in. Can you tell why?

    I've struggled since Facebook has said that someone tried to enter in my accouant and they had me off facebook about 3 days. Who would have something to do with it?

    Impatient of solve you this problem, because I REALLY don't like this game.

    Thanks for taking care of this

    hope that I broke all the rules. and I hope that I chose the right forum because I've NEVER done this before.

    original title: GAME MAHJONG TRAILS Can t PLAY WHY

    Hello Shirley,

    This isn't a problem with MSE.  You deal with Facebook on this (as hard as I know what to do).

    There is an excellent chance that what has happened to your account either interfered with your game or was not completely fixed or there is something else wrong with your account or maybe the game.  Your best bet is to start here: http://www.facebook.com/mahjongtrails#! /help/? section = applications_and_websites and see if you can get help any with the game or the other answers predefined or by searching.  Then, would be to try general help: http://www.facebook.com/help/?topic=applications_and_websites#! /help/? tab = discussion where you can post questions about your problem.  If possible, I try to uninstall and reinstall the game (even if it make you lose your points or your rankings) - or you can ask for help from their first that they are able to help.  Or open a new facebook account in the meantime and see if you can download and play the game on this account.  So not only will you be able to play, but you will know for sure, this isn't a problem with your computer, the game, your browser or malicious software.  You can pretty well and nail down to a problem with the other account or installing the game on this account.

    It is almost certainly a problem with Facebook and not your computer, malicious software or your browser.  You need to deal with them on this subject.  If you have the best technical support coordinated because of your recent problems, by all means to re-open the case, or get help that direct contact is all but impossible here trying.

    I'm sorry, we can not help you more, but it's really a matter of Facebook and you need to deal with them to resolve the issue.

    Good luck!

  • can someone tell me why I can't update to El Capitan 10.11.2? the line "Show details" gets up and I click on it to make the update. When I do this, it just goes back to doing nothing, so I can never get past this point.

    can someone tell me why I can't update to El Capitan 10.11.2?

    When I try to update "updates available have changed" guest shows up.i click "Show details" prompt to complete the update and when I do that, it just goes back to doing nothing, so I can never get past this point. can someone help me with this, please?

    Thank you very much.

    In some cases, this error message is caused by a problem in the network. Restart your router as your device at wide band, if they are separated. If there is no change, see below.

    This procedure will remove some temporary and cache files. The files are generated automatically and do not contain any of your data. Sometimes they can become corrupted and cause problems like yours.

    Please, back up all data and read this message before doing anything.

    Triple-click anywhere in the line below on this page to select this option:

    /var/folders/zz/zyxvpxvq6csfxvn_n00000s0000068

    Right-click or Ctrl-click on the highlighted line and select

    Services ▹ reveal in Finder (or just to reveal)

    the contextual menu.* file should open with a selected subfolder. The subfolder has a long name beginning with "zyx" and ending with "68". Place this subfolder in the trash. Do not move other subfolders with similar names. You may be prompted for administrator login password. Restart the computer and empty the trash.

    * If you do not see the item context menu copy the selected text in the Clipboard by pressing Control-C key combination. In the Finder, select

    Go ▹ go to the folder...

    from the menu bar and paste it into the box that opens by pressing command + V. You won't see what you pasted a newline being included. Press return.

  • Can someone tell me why my phone will not be updated? I can't put it to day/download apps either.

    Can someone tell me why my phone will not be updated? I can't put it to day/download apps either.

    Try to reset the App Store:

    Close the App Store completely from the window of the selector app by double clicking the Home button and slide up the App Store preview pane until it disappears from the display. You may be able to pick up the tab App Store covering scribbles to the left.

    Then sign out of the iTunes Store (in the settings).

    Then perform a forced reboot. Hold down the Home and Sleep/Wake buttons simultaneously for about 15-20 seconds, until the Apple logo appears.

    Then reconnect to the iTunes Store.

    Also try by going to settings > general > Restrictions > and make sure that iTunes Store, Apps install, delete the Apps and In - App purchases are all under the section allow. Try to install again.

  • Can someone tell me why 'Script Skipper' has been disabled by the administrator?

    I'm looking for a script that disables javascript prior to load a Web page. I was told that the Script Skipper is such an addin. But this script has been disabled by the administrator. Can someone tell me why?

    This add-on? Or can you find a more recent version of this elsewhere?

    https://addons.Mozilla.org/en-us/Firefox/addon/script-skipper-3x/

    Version 1.0.2
    Published on August 28, 2010 14.3 KB
    Works with Firefox 1.5 - 4.0b4

    With only 69 users without ever obtaining a comprehensive review and was never updated to the version of Firefox 4 + -, I would classify it abandoned further.

  • I just upgraded my Firefox to version 9.0.1, I get multi-page opening now when I launch my browser. A page is my home page, another is welcome to Firefox, and the other is my LassPass. Can anyone tell my why this is happening?

    A page is my home page, another is welcome to Firefox, and the other is my LassPass. Can anyone tell my why this is happening?

    Create a new profile as a test to see if your profile is the source of the problems.

    See "basic troubleshooting: a new profile:

    There may be extensions and plugins installed by default in a new profile, so check that in "tools > Modules > Extensions & Plugins" in case there are still problems.

    If this new profile works then you can transfer files from the old profile to the new profile, but make sure not to copy corrupted files.

    See:

  • When I updated the shock of the clans for my daughter on his iPad, it has its own apple ID. and iCloud, my ID apple came on his id for the update, where it has its own apple ID now. Please can someone tell me why the update came not through its id.

    When I updated the shock of the clans for my daughter on his iPad, it has its own apple ID. and iCloud, my ID apple came on his id for the update, where it has its own apple ID now. Please can someone tell me why the update came not through its ID thanks

    It seems that if the application has been downloaded on his iPad while it is connected to your Apple ID. If so, he'll always want to be updated with your Apple ID.

    You must remove the application from his iPad and then download it again while it is connected to its own code of Apple.

Maybe you are looking for

  • Turn turns off Siri in iOS 10?

    How can I disable Siri completely in iOS 10?  My Touch ID does not work most of the time, and since I am now the button Home Siri comes up and tried to compose random contacts people.  I can't get Siri to stop and I have to so quickly turned off to k

  • Chest x-ray: googles does not work

    They allow you to remix of the current page, I'm trying to do, but I wasn't a defense shield comes to address bar in most of the sites and I can't use it tell me settings so fire fox does not block it.

  • Sony memory stick pro duo of

    I recently bought the HP dm4-2070us. works on multimedia port with the memory stick sony pro duo? The adapter not blocking or read the card? Thoughts?

  • vocal mic. Sam. need a new.

    I always want my mic.sam voice to not sound like a squirrel in any case to have another voice or difficulty of him tried to deepen his voice. anyway to download new voices.   Thank you cindy

  • NAS200: The user Creation will fail.

    Hello! I just got my new NAS200 and I can't create users, when I hit ADD and then type in my new user name and password and press SAVE, it does nothing, same thing in IE and Firefox. In Internet Explorer, it presents this brand yellow error, says som