• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about locks in servlets and in JSP

 
nilima komala
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Every Body

I have one snippet that when user entered his details wrong for 3 times he would be restricted to log on to that by providing locks unless until the administrator allows him to access and this should be done by using tables in Oracle.
My question is how can we provide lock and release the lock in Servlets or in Jsp and how can we lock the resources by using the database.

Thank you in Advance


Best Regards,
komala
[ February 19, 2006: Message edited by: Bear Bibeault ]
 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should be moved to servlets / jsp forum.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and so it shall be

Please look for this thread in the Servlets forum.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33683
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Komala,
You would use JDBC to read/update a lock flag for each user in the Oracle database. When a user logs on, you would check this lock flag in addition to the password.
 
nilima komala
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir,
Thank you for your reply. Can you please explain it with an example sir please.

Once again thank you.



Best Regards,
komala
 
dema rogatkin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using login feature of servlet/jsp container or provide own login procedure? In case of own login procedure locking a user shouldn't be a question, however when you use a container you have to be more creative. You can use a trigger if a contaner authenticate a user against a table in a database. However if your user repository is LDAP or some other directory you can either look how to setup number of failed attempts for a directory you use, or you can setup a filter which counts login attempt and locks login attempt for a blackouted user name. You can also restrict attempts of guessing user name count login attempt from certain IP, cookie and user agent.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic