Guest User

Untitled

a guest
Oct 22nd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. auth
  2. .jdbcAuthentication()
  3. .dataSource(dataSource).passwordEncoder(new Md5PasswordEncoder())
  4. .usersByUsernameQuery("select username,password,enabled from user where username=?")
  5. .authoritiesByUsernameQuery("SELECT role from user_role inner join user on user.id_user_rol = user_role.id where user.username=?");
  6.  
  7. CREATE DATABASE db_srp;
  8.  
  9. USE db_srp;
  10.  
  11. CREATE TABLE user_role(
  12. id int auto_increment,
  13. role varchar(15),
  14. PRIMARY KEY(id)
  15. );
  16.  
  17. CREATE TABLE user(
  18. id int auto_increment,
  19. username varchar(50),
  20. password varchar(100),
  21. enabled boolean,
  22. id_user_rol int,
  23. PRIMARY KEY(id),
  24. FOREIGN KEY(id_user_rol) REFERENCES user_role(id)
Add Comment
Please, Sign In to add comment