diff --git a/core/src/main/java/org/springframework/security/core/userdetails/jdbc/JdbcDaoImpl.java b/core/src/main/java/org/springframework/security/core/userdetails/jdbc/JdbcDaoImpl.java index 347d820a99..47dcf9b4a9 100644 --- a/core/src/main/java/org/springframework/security/core/userdetails/jdbc/JdbcDaoImpl.java +++ b/core/src/main/java/org/springframework/security/core/userdetails/jdbc/JdbcDaoImpl.java @@ -110,6 +110,8 @@ import org.springframework.util.Assert; */ public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService, MessageSourceAware { + public static final String DEFAULT_USER_SCHEMA_DDL_LOCATION = "org/springframework/security/core/userdetails/jdbc/users.ddl"; + // @formatter:off public static final String DEF_USERS_BY_USERNAME_QUERY = "select username,password,enabled " + "from users " diff --git a/docs/modules/ROOT/pages/servlet/authentication/passwords/jdbc.adoc b/docs/modules/ROOT/pages/servlet/authentication/passwords/jdbc.adoc index d4462eaaf8..c5ca66a613 100644 --- a/docs/modules/ROOT/pages/servlet/authentication/passwords/jdbc.adoc +++ b/docs/modules/ROOT/pages/servlet/authentication/passwords/jdbc.adoc @@ -116,7 +116,7 @@ In our example, we will setup an https://docs.spring.io/spring-framework/docs/cu DataSource dataSource() { return new EmbeddedDatabaseBuilder() .setType(H2) - .addScript("classpath:org/springframework/security/core/userdetails/jdbc/users.ddl") + .addScript(JdbcDaoImpl.DEFAULT_USER_SCHEMA_DDL_LOCATION) .build(); } ---- @@ -136,7 +136,7 @@ DataSource dataSource() { fun dataSource(): DataSource { return EmbeddedDatabaseBuilder() .setType(H2) - .addScript("classpath:org/springframework/security/core/userdetails/jdbc/users.ddl") + .addScript(JdbcDaoImpl.DEFAULT_USER_SCHEMA_DDL_LOCATION) .build() } ----