protected MessageFormat resolveCodeInternal ( String code , Locale locale ) { String result ; lastQuery = System . currentTimeMillis ( ) ; try { result = ( String ) jdbcTemplate . queryForObject ( sqlStatement , new Object [ ] { code , locale . toString ( ) } , String . class ) ; } catch ( IncorrectResultSizeDataAccessException e ) { if ( locale != null ) { // Retry without a locale if we checked with one before try { result = ( String ) jdbcTemplate . queryForObject ( sqlStatement , new Object [ ] { code , null } , String . class ) ; } catch ( IncorrectResultSizeDataAccessException ex ) { return null ; } } else { return null ; } } return new MessageFormat ( result , locale ) ; }
Check in base the message associated with the given code and locale