private void updateFalseLoginDB ( final int _tries ) throws EFapsException { Connection con = null ; try { con = Context . getConnection ( ) ; Statement stmt = null ; final StringBuilder cmd = new StringBuilder ( ) ; try { cmd . append ( "update T_USERPERSON " ) . append ( "set LOGINTRY=" ) . append ( Context . getDbType ( ) . getCurrentTimeStamp ( ) ) . append ( ", LOGINTRIES=" ) . append ( _tries ) . append ( " where ID=" ) . append ( getId ( ) ) ; stmt = con . createStatement ( ) ; final int rows = stmt . executeUpdate ( cmd . toString ( ) ) ; if ( rows == 0 ) { Person . LOG . error ( "could not execute '" + cmd . toString ( ) + "' to update last login information for person '" + toString ( ) + "'" ) ; throw new EFapsException ( getClass ( ) , "updateLastLogin.NotUpdated" , cmd . toString ( ) , getName ( ) ) ; } } catch ( final SQLException e ) { Person . LOG . error ( "could not execute '" + cmd . toString ( ) + "' to update last login information for person '" + toString ( ) + "'" , e ) ; throw new EFapsException ( getClass ( ) , "updateLastLogin.SQLException" , e , cmd . toString ( ) , getName ( ) ) ; } finally { try { if ( stmt != null ) { stmt . close ( ) ; } } catch ( final SQLException e ) { throw new EFapsException ( getClass ( ) , "updateLastLogin.SQLException" , e , cmd . toString ( ) , getName ( ) ) ; } } con . commit ( ) ; con . close ( ) ; } catch ( final SQLException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } }
Method to set the number of false Login tries in the eFaps - DataBase .