User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 427,224 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,245 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 355 | Replies: 3
Reply
Join Date: Nov 2007
Location: Nigeria
Posts: 49
Reputation: tactfulsaint is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Light Poster

Login authentication

  #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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Location: Greece
Posts: 555
Reputation: javaAddict will become famous soon enough javaAddict will become famous soon enough 
Rep Power: 3
Solved Threads: 63
javaAddict's Avatar
javaAddict javaAddict is offline Offline
Posting Pro

Re: Login authentication

  #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)
I AM the 12th CYLON
Reply With Quote  
Join Date: Aug 2006
Location: Noida, India
Posts: 158
Reputation: Luckychap is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 17
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Junior Poster

Re: Login authentication

  #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  
Join Date: Nov 2007
Location: Nigeria
Posts: 49
Reputation: tactfulsaint is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Light Poster

Re: Login authentication

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 11:32 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC