posted 16 years ago
Two ways, that suddenly come to my mind :
1) If your DB design is not yet complete/not yet baselined, please make modifications so that you can keep track of how many times a user [based on his/her username] tried logging in without success.
2) Create a singleton class which wraps a Map implementation, which will keep track of the same, and update the values in that.
Item 2 will save you on time, since you dont have to keep updating a DB everytime, and hence improving on performance. But at the same time, if your userbase is huge, you can end up creating
a rather enormous Map. Choose any of this [or any better solution] based on the exact business requirements you have [ie user base, performance requirements etc.]
Either way, you need to turn the counter to zero, once the user was able to log in successfully.