• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to check user login using servlet+mysql

 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
problem solved and mistake is usertype...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic