Login thru JSP not working?

Hello
I am trying to login thru JSP, Web Server is Tomcat & database is sqlserver2000. After filling user, password & pressing submit button,error message is as follows :
cannot resolve symbol
symbol : variable connection
location: class org.apache.jsp.verifyuser_jsp
Statement statement = connection.createStatement();
This is the code :
<BODY>
<% String user = request.getParameter("user");%>
<% String pwd = request.getParameter("pwd");%>
<%
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connection = DriverManager.getConnection(
"jdbc:odbc:DEVELOPER1","sa","");
System.out.println("database connected");
Statement statement = connection.createStatement();
String query1 = "SELECT Username, Password FROM login WHERE Username = '"+user+"' AND Password = '"+pwd+"'";
ResultSet p = statement.executeQuery(query1);
while (p.next())
String Puser = p.getString("Username");
String Ppass = p.getString("Password");
if (user.equals("Puser") && pwd.equals("Ppass"))
%>
<jsp:forward page = "welcome.jsp"/>
<% else { %>
<h3>Invalid username or password</h3>
<% }
connection.close();
catch (Exception e)
out.println(e.getMessage());
%>
<h3>error in accessing database</h3>
<% }
%>
</BODY>
what's wrong?

import java.sql.* package is given, even then its not working.

Similar Messages

  • Maverick update now my login screen does not work please help.

    Hello hope you can help.  I have a 24 inch Mid 2007 Intel iMac.  It has been great until now.  I recently did the Maverick update and now my login screen does not work.  When I wake the computer up the screen appars with my picture icon.  When I click on it nothing happens.  If I click on it a second or third time the beach ball appears and nothing happens.  I have to shut the unit down with the power button and when the unit powers back up everything works normally.  Are there any suggestions out there?  I have updated the software without resolution. Is this computer too old?   Do I have to buy a new one?
    Thank you

    Your iMac can support Mavericks according to the requirements > OS X Mavericks: System Requirements
    Try a Safe Mode boot. That deletes some system caches that may help.
    Startup your Mac in Safe Mode
    A Safe Mode boot takes much longer than a normal boot so be patient.
    Once you are in Safe Mode, click Restart from the Apple () menu.
    See if there's an improvement for the login screen.

  • My login password is not working when i try to log in to my macbook air. what should I do?

    my login password is not working when i try to log in to my macbook air. what should I do?
    Thanks, Debora

    You can reset the password.
    How you do it though depends on the version of OS X you are running.
    On Lion or Mountain Lion, you use the following technique to reset the Administrators password:
    Boot to your Recovery Partition, by holding down the Option key while starting, and then selecting the Recovery HD as the boot choice.
    Once booted, at the top of the screen is a menu ..., select Utilities / Terminal from the menu bar.
    In the Terminal window, type “resetpassword” (without the quotes) and press return. A “Reset Password” window will open. Select your boot volume (your SSD drive) if it is not already selected. Select your administrators username from the menu labeled “Select the user account” if it is not already selected. Follow the prompts to reset the password. Restart the computer from the apple menu.
    If you are using the Keychain, you will lose your existing one, and have to start a new one, unless  you remember the old password.

  • WSX Login Cred. Not Working In Win. 7

    Hello,
    I have workstation 10 on a windows 7 machine which runs serveral VM's very well.  I moved one of them over to the shared VM section and installed WSX server on the same machine to try it out.  The install went fine and i can connect to the WSX server on the same machine and any other machine on the network but the windows login credentials do not work.  I have two admin accounts and neither of the logins work.....however, when i make a brand new admin account and try to login into WSX it works fine.  As soon as the machine restarts though that same login stops working. I have no idea what is going on, you guys have any ideas?
    Thanks,
    Brandon

    I have the same issue. I attempted the resolution by BlazerGT with no success. I have found the issue to be persistent with both domain and local accounts. For local accounts simply deleting the account and re-adding it was a workable solution but I have not found one with the domain accounts. If there is a log for failed authentication I would love for a developer to let me know where this is as it would be greatly helpful to be able to diagnose.

  • Help pls ! JSP not working in tomcat

    Hi techies,
    I have a problem in executing jsp files thru tomcat on windows
    The problem is i have my jsp files in a directory, i use virtual directory concept by setting up context in server.xml file to access my jsp, servlets and html files and some jsp files are working properly, but certain jsp files are not working...
    It gives an error saying " jsp file not found.." even though the file is in the directory
    Can anyone help to come-out of this problem.
    Rgds
    sathish

    Hi,
    if you are trying to map a short name to a jsp page, you should do that in the web.xml file not in the server.xml i think...
    Hope this help...

  • After a restore from Time Machine my login password does not work.

    My HD crashed and I replaced the HD.  I then restored from Time Machine.  After it was done restoring it prompted me for my apple ID and password and account info.  Now when I try to login, the password does not work.  After several failed passwords, it says I can reset my password using my apple ID.  How do you do this?  I click on the message and it just disappears.  I can't login!

    Is it your actual Apple ID login password that you're talking about (which is obviously working since you got into this forum) or the password for your user account. If the latter, simply boot to your ML Recovery partition (holding down the Command and R keys while booting) and set a new password via Terminal.
    Boot into your Recovery partition and, from the Utilities menu, open Terminal. In Terminal, type in:
    resetpassword
    ...a small app will run allowing you to select a user and change the password for that use. Enter the new password twice (the second time to verify) and give yourself a password 'hint'. Then reboot and use your new password on your account.
    Clinton

  • JSP Not Working with Thin Driver

    My JSP is not working with Oracle thin driver but it is working with Oracle OCI driver.
    From my jsp i am calling a stored procedured and passing 170 parameters to the procedure. This JSP works with Oracle OCI Driver configured as thrid party drivers in iAS6.0 SP2, but not working with Oracle Thin Driver configured as third party drivers in iAS6.0. My thin driver JDBC Connection URL is as follows:
    jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = MAPDBI01)(PORT = 1521)))(CONNECT_DATA =(SID = MAPS))).
    I have to give this URL because my production server deployment consists of iWS4.1 SP5 and iAS6.0 SP2 in different solaris boxes and Oracle 8.1.7 Database server in another Solaris Box. There is a pool of proxy servers between iAS6.0 box and the oracle box.

    Wim,
    I'd really appreciate it if you could provide some sample code. A complete, small, simple java class that I could copy and try out would be wonderful -- if it's not too much trouble.
    Thanks heaps (in advance :-),
    Avi.

  • Hyperlink to file in JSP not working

    I have a JSP page where I am providing a hyperlink to a file on the C: drive as follows
    Try this
    Nothing happens when I click this hyperlink.
    When I scroll over the hyperlink I see the correct path "file:///C:/ReqImport/data.txt" in the status bar and when paste this path in my address bar, it does open up the file.
    Any ideas why this file hyperlink does not work on this JSP page.
    Thanks

    Hmm, you're right, I just tried it and it doesn't appear to work. It looks like a security thing: If the original page is on my hard drive, links to other files on my hard drive work. But when the original page is on a web server, links to files on my hard drive don't appear to work.
    Do you realize that such a link is referring to a file on the C: drive of the client, the user, not the C: drive of the server? I'm not sure what you're up to, but for most applications such a link is pretty much useless, as you normally have no way of knowing what files the user has on his C: drive.

  • Include file in jsp not working

    Hi ,
    I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
    My include code looks like this :
    <%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
    <!--#include virtual="includes/footer.html" -->
    My jsp file is hosted on IIS

    nb123 wrote:My jsp file is hosted on IIS
    Hi ,
    I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
    My include code looks like this :
    <%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
    <!--#include virtual="includes/footer.html" -->
    My jsp file is hosted on IIS
    Check the path you've specified. It may well be;
    <%@include file="hello.jsp" %>or
    <%@include file="/Includes/hello.jsp" %>

  • Immediate login, custom redirect not working correctly

    I have a page with some conditional regions on it: show if user is logged in, else show something else. That sort of thing.
    This page is a tease to convince users to register so there a prominent "If you're a member, log in here, if not register for free."
    If someone clicks the Register button, they are taken to the registration page along with a url variable to identify the place they've just come from.
    The registration page has an Immediate Login trigger on it - which has always worked without a hitch.
    The registration page also has some conditional redirect triggers attached to the registration insert. The conditional redirect triggers GET the url variable being passed and if the condition is matched, the registration page sends them back where they came from - just like a login function would - registered and now logged in due to the immediate login trigger.
    This has all worked wonderfully until this past weekend when the whole system fell apart.
    For reasons unknown, the immediate login has stopped working. The redirect continues to work but people are correctly returned to the page with the logged in/logged out conditional regions but doing so without getting logged in, so of course they see the same stuff they just saw - stuff telling them to register or login.
    Immediate login continues from every other direction, just this particular set of redirections seems to totally wonk out the person returning from the registration page properly logged in.
    Anyone with any experience with this kind of thing? It's very essential to the way my web operation works.
    I deeply appreciate any interest or advice.

    Nope. This is the strangest thing I've encountered.
    After changing the conditional trigger to AFTER, it worked once. I logged out to test again. Now it's right back to not working. Shut down the browser too.
    As before, the redirect works as it's supposed to but the user gets redirected without being logged in.

  • Script to open Remote Login in "sharing" not working after move to 10.5

    Under 10.4 I sued the following script to open Remote Login (tick the box). Under 10.5.6 it does not work.
    do shell script "/usr/bin/open /System/Library/PreferencePanes/SharingPref.prefPane"
    activate application "System Preferences"
    tell application "System Events"
    tell process "System Preferences"
    click checkbox 1 of row 6 of table 1 of scroll area 1 of tab group 1 of window "Sharing"
    delay 3
    tell application "System Events"
    quit application "System Preferences"
    end tell
    end tell
    end tell
    I get the following error:
    System Events got an error: Can’t get tab group 1 of window "Sharing" of process "System Preferences". Invalid index.
    Anybody know why?

    give this a spin
    activate application "System Preferences"
    tell application "System Events"
    tell process "System Preferences"
    click button "Sharing" of scroll area 1 of window "System Preferences"
    select scroll area 1 of group 1 of window "Sharing"
    select static text "File Sharing" of row 3 of table 1 of scroll area 1 of group 1 of window "Sharing"
    select checkbox 1 of row 3 of table 1 of scroll area 1 of group 1 of window "Sharing"
    click button "Options…" of splitter group 1 of group 1 of window "Sharing"
    click checkbox "Share files and folders using FTP" of sheet 1 of window "Sharing"
    delay 0.5
    select button 2 of sheet 1 of window "Sharing"
    keystroke return
    delay 0.5
    tell application "System Events"
    quit application "System Preferences"
    end tell
    end tell
    end tell
    -----------------

  • SMB - domain login from XP not working

    I have been testing using my MacOSX 10.5.3 server as PDC for Windows XP machines. I set it up on my test server with no problems. Enabled the SMB service, promoted it to a Primary Domain Controller and then a few other minor tweaks and away we went. I got mapped home folders and login script work really quickly. Because of this success I decided to integrate it into a server roll out I am doing at the moment with an Xserve and OSX10.5.4. I setup the SMB service promote it to a PDC and everything is perfect. I get a clean built Windows XP SP2 machine connect it to the domain, reboot, go to login but I get an error saying that "Windows cannot connect to the domain, either because the domain controller is down or otherwise unavailable or because you computer account was not found....".
    After check things several times as well as other people confirm various options I am lost.
    To add further confusion I went back to my test server removed my XP machine from the domain and re-added it to start testing my problem and holy cow I got the same error message.
    The only difference is the 10.5.4 update I did after I setup my test server must have changed something thats stops me from logging in. Can anyone help??

    import java.sql.* package is given, even then its not working.

  • Login with facebook not working

    Unable to login to spotify desktop app (windows 7) with facebook login credentials.

    I am having the same issue...  I have even tried that cool trick where you use your facebook email and your facebook password and that does not work. I have uninstalled, re-installed, restarted, Tried to click on music to play in spotify, nothing. I am running the current version since I downloaded it again about 15 minutes ago.  I have premium, and I am using windows 7 os.  When I try to log in the non facebook way it says "service is temporarily unvailable, please try again later."  When I try to use the 'log on with facebook, it opens a window in my chrome browser and that line says 'logging in to spotify' and it closes the window and makes the login to facebook button unclickable.   All my updates are current on my computer.  My antivirus does not see spotify as a threat.  IE does not work either.  I have tried pretty much everything.  I am frustrated and really would like to have my music back.

  • Had to erase hd and reboot from time machine.  Now login password does not work

    Had to erase hd and reboot from time machine.  Now login password does not work

    Stick the OS X 10.6 install disk and reboot the computer holding c down.
    Second screen in is a Utilities menu with Password Reset, try that.

  • Including external Javascript file in JSP- not working on Mozilla Firefox

    I have a JSP page which includes javascript file as below:
    <script type="text/javascript" src="https://siteAddress/scripts/myJsFile.js"></script>
    myJsFile.js has a method testFireFox()
    There is a link on JSP which that calls this method.
    <a href="#" onClick="testFireFox()">Some Text...</a>
    As soon as i click on the link, nothing happens and this error appears on console:
    Refrence Error: testFirefox() is not definedI tried giving the path for JS file in various ways but it did not help.
    Note: This works absolutely fine in Internet Explorer.
    I have not added Javascript to document.ready or onLoad event. It is simply been referred in <Head>
    tag any pointers pls..

    This forum is intended for user support, not for web development issues.
    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The contributors over there are more knowledgeable about web page development issues with Firefox.
    http://forums.mozillazine.org/viewforum.php?f=25
    You'll need to register and login to be able to post in that forum.

Maybe you are looking for

  • FI table for Report painter

    Which table I will take to create FI report in Report Painter ? Please help me.. Thanks & Regards, Ananda

  • .dbg files in the utl_file_dir

    Hello Guru's, I have several .dbg files sitting in the utl_file_dir. These files pertain to an E-Business 11.5.9 installation. Can these be safely removed?

  • Birthday Skype Gift Card link doesn't work

    There's even a bunch of smart arse comments on the page you do eventually reach. Can you idiots even manage to get the parts of this program that are YOUR BREAD AND BUTTER correct?

  • Airport/Airplay - Airplay works on iphone, not itunes?

    Hi everyone I've got a strange problem here. I have an old airport express (802.11g, 6.3) which is wired by ethernet to my livebox wireless router. I can stream by airplay mp3s from my iphone in the ipod app with no problems at all! but through iTune

  • Fixed value assignment while creating Domain

    Hi All, While creating a Domain with data type 'CHAR', No. characters 13, in Value Range > Fixed Value i had given 'TEST_MATERIAL' but it only takes first 10 Characters (TEST_MATER). I wan to display all characters. how can I solve it. Points Assured