Login authentication

Reply

Join Date: Nov 2007
Posts: 62
Reputation: tactfulsaint is an unknown quantity at this point 
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Junior Poster in Training

Login authentication

 
0
  #1
Jul 9th, 2008
i need help with login mechanism, i have this application that i am trying to add a login form but i dont know how to authenticate the username and password..
i need to learn how to send the username and password to the database and when the user logs in it should retrieve the password from the database and authenticate if the username and password is correct.

and a code snipet that can help a new member create a new account in the app. ie for non members to create a new username and password, just like openin a new yahomail account.

i need a code snippet that can help me achieve both problems
help from anyone would be appreciated. jwenting,isreal and others pls.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 1,668
Reputation: javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all 
Solved Threads: 225
Featured Poster
javaAddict's Avatar
javaAddict javaAddict is offline Offline
Posting Virtuoso

Re: Login authentication

 
0
  #2
Jul 10th, 2008
In a separate class write a method that takes two arguments (username, password). That method should query the database using these two arguments, in order to check if there is such record. If the above combination (username, password) exists then the method should return true, otherwise false.
Then create a gui where the user inputs username, password. Take these values, call the above method and if it returns true, then the user should login.

As for creating a new member, in the above class create a method that takes two arguments (username, password) and performs an INSERT in the database.
Then create a gui where the user inputs username, password. Take these values and call the above method.

And you don't specify what will you use for the login form. (.jsp or swing)
Check out my New Bike at my Public Profile at the "About Me" tab
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 319
Reputation: Luckychap is on a distinguished road 
Solved Threads: 42
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Posting Whiz

Re: Login authentication

 
0
  #3
Jul 10th, 2008
Its all about JDBC.
When you think you have done a lot, then be ready for YOUR downfall.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 62
Reputation: tactfulsaint is an unknown quantity at this point 
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Junior Poster in Training

Re: Login authentication

 
0
  #4
Jul 18th, 2008
Originally Posted by javaAddict View Post
In a separate class write a method that takes two arguments (username, password). That method should query the database using these two arguments, in order to check if there is such record. If the above combination (username, password) exists then the method should return true, otherwise false.
Then create a gui where the user inputs username, password. Take these values, call the above method and if it returns true, then the user should login.

As for creating a new member, in the above class create a method that takes two arguments (username, password) and performs an INSERT in the database.
Then create a gui where the user inputs username, password. Take these values and call the above method.

And you don't specify what will you use for the login form. (.jsp or swing)
thanks JavaAddict could you help me with a code snippet to achieve that for jsp and swing?.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC