public void secureDatabase() {

        logger.debug("<<<< DatabasePasswordSecurerBean is running!!! >>>>>");

        getJdbcTemplate().query("select username, password, password_encrypted from users", new RowCallbackHandler() {
            @Override
            public void processRow(ResultSet rs) throws SQLException {
                String username = rs.getString(1);
                String password = rs.getString(2);
                boolean passwordEncrypted = rs.getBoolean(3);

                UserDetails user = userDetailsService.loadUserByUsername(username);
                String encodedPassword = passwordEncoder.encodePassword(password, saltSource.getSalt(user));

                if (encodedPassword != null && !encodedPassword.equals(password) && !passwordEncrypted) {
                    getJdbcTemplate().update(
                            "update users set password = ?, password_encrypted = ? where username = ?",
                            encodedPassword, Boolean.TRUE, username);
                    logger.debug("Updating password for username:" + username + " to: " + encodedPassword);
                }

            }
        });
        
        logger.debug("<<<< DatabasePasswordSecurerBean has finished!!! >>>>>");
    }