wood burning stoves 2.0*
The moose likes JDBC and the fly likes unable to check user login using servlet+mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "unable to check user login using servlet+mysql" Watch "unable to check user login using servlet+mysql" New topic
Author

unable to check user login using servlet+mysql

Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

Hi I was unable to check user logins ,I have written servlet and two class files,one is for connecting to database and one is for performing login process,when i ran this code nothing i am getting and can somebody tell me please
Database1.java file

userMain.java

loginCheck.java


login.jsp


Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

con=DriverManager.getConnection("jdbc:mysql://"+server+"/"+database,user,password);


1.is it compiled?

2.Please tell the exception/error that what you are getting ?
Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

yes its compiled and when i entered username,password in login page nothing is showing and in tomcat status also nothing is showing
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

What is the error message in the logs?

Also note that the following is asking for trouble - if you have a fatal error, you don't want to log it and then continue! You want to abort.
[code] catch(Exception ex)
{
System.out.println(ex.toString());
} /code]


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

I made changes to the code and then also unable to check login and here is the modified code and In tomcat window i got the following messages
Entered UserName=pol19
Entered password=polo
user_id=0
login failed

usermain.java

here is my servlet loginCheck.java
Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

problem solved and mistake is usertype...
 
Don't get me started about those stupid light bulbs.
 
subject: unable to check user login using servlet+mysql
 
Similar Threads
JSTL+Servlet+beans
Problem with the "where" query.
tomcat return an error +mvc
Problem in SessionManagement in Struts
How to display retrivied users from the Datase into Drop-down menu using servlet+JSP(JSTL)