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 ]
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.
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
Joined: Oct 09, 2002
Posts: 294
posted
0
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.
Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>