This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes how do i validate id and password using servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how do i validate id and password using servlet" Watch "how do i validate id and password using servlet" New topic
Author

how do i validate id and password using servlet

ammuswar kumar
Greenhorn

Joined: Aug 19, 2001
Posts: 27
sir
how do i validate id and password(using database) using servlet
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

How about:

Don't take this verbatim. I probably didn't code the jdbc correct, since I'm doing it from memory. Also, a robust app should allow for the fact that if the user ID or password was not set by the client you'll get "null" as a value. Finally, you should either do a parameterized query or SQL-escape the text, since the above will fail for a user ID like "d'Souza".


Customer surveys are for companies who didn't pay proper attention to begin with.
ammuswar kumar
Greenhorn

Joined: Aug 19, 2001
Posts: 27
thanks tim
u just gave me a start ,but i quite new to the database connectivity i need the connection statement say using jdbc dbc bridge using sqlserver cos the userid and password has to be copared with the database and then return the value,
if possible could u please send the more elaborated program as per the requirement
thanks for the help though
amit
 
Consider Paul's rocket mass heater.
 
subject: how do i validate id and password using servlet