core/src/main/java/org/springframework/security/provisioning/JdbcUserDetailsManager.java
protected List<UserDetails> loadUsersByUsername(String username) {
		return getJdbcTemplate().query(getUsersByUsernameQuery(), new String[]{username},
				(rs, rowNum) -> {

					String userName = rs.getString(1);
					String password = rs.getString(2);
					boolean enabled = rs.getBoolean(3);

					boolean accLocked = false;
					boolean accExpired = false;
					boolean credsExpired = false;

					if (rs.getMetaData().getColumnCount() > 3) {
						//NOTE: acc_locked, acc_expired and creds_expired are also to be loaded
						accLocked = rs.getBoolean(4);
						accExpired = rs.getBoolean(5);
						credsExpired = rs.getBoolean(6);
					}
					return new User(userName, password, enabled, !accExpired, !credsExpired, !accLocked,
							AuthorityUtils.NO_AUTHORITIES);
				});
	}
protected List<UserDetails> loadUsersByUsername(String username) {
		return getJdbcTemplate().query(getUsersByUsernameQuery(), new String[]{username},
				(rs, rowNum) -> {

					String userName = rs.getString(1);
					String password = rs.getString(2);
					boolean enabled = rs.getBoolean(3);

					boolean accLocked = false;
					boolean accExpired = false;
					boolean credsExpired = false;

					if (rs.getMetaData().getColumnCount() > 3) {
						//NOTE: acc_locked, acc_expired and creds_expired are also to be loaded
						accLocked = rs.getBoolean(4);
						accExpired = rs.getBoolean(5);
						credsExpired = rs.getBoolean(6);
					}
					return new User(userName, password, enabled, !accExpired, !credsExpired, !accLocked,
							AuthorityUtils.NO_AUTHORITIES);
				});
	}
protected List < UserDetails > loadUsersByUsername ( String username ) { return getJdbcTemplate ( ) . query ( getUsersByUsernameQuery ( ) , new String [ ] { username } , ( rs , rowNum ) -> { String userName = rs . getString ( 1 ) ; String password = rs . getString ( 2 ) ; boolean enabled = rs . getBoolean ( 3 ) ; boolean accLocked = false ; boolean accExpired = false ; boolean credsExpired = false ; if ( rs . getMetaData ( ) . getColumnCount ( ) > 3 ) { //NOTE: acc_locked, acc_expired and creds_expired are also to be loaded accLocked = rs . getBoolean ( 4 ) ; accExpired = rs . getBoolean ( 5 ) ; credsExpired = rs . getBoolean ( 6 ) ; } return new User ( userName , password , enabled , ! accExpired , ! credsExpired , ! accLocked , AuthorityUtils . NO_AUTHORITIES ) ; } ) ; }
Executes the SQL <tt>usersByUsernameQuery</tt> and returns a list of UserDetails
objects. There should normally only be one matching user.
Executes the SQL <tt > usersByUsernameQuery< / tt > and returns a list of UserDetails objects . There should normally only be one matching user .