Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Checking lock time and removing record after 24 hours

Christy H.Feb 8 2017 — edited Feb 8 2017

I am working on login system where the scenario is that after 3 failed login tries I have to block user for 24 hours.

  1. When user provides wrong credentials then I start inserting and counting fail login tries with java program in the following table:

create table FailedLoginTries(

  try_id number primary key,

  try_date timestamp(0) default sysdate,

  lock_date timestamp(0) default sysdate

  user_id number references users(user_id) on delete cascade,

  attempts number(3),

  isLocked number(2)

);

I want to show user if his/her account is locked that:

  • How much time left to un-lock account and
  • To auto remove locked record from database table

I mean that:

when user made 3 failed tries then account will be marked as 1 that is considered blocked and will remain block till 24 hours. After 24 hours this will be auto un-locked and after unlocking record will be removed from the table

Thanks in anticipation

Best regards

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2017
Added on Feb 8 2017
25 comments
2,635 views