Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do i validate id and password using servlet

 
ammuswar kumar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir
how do i validate id and password(using database) using servlet
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18218
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
ammuswar kumar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic