November 2017
Intermediate to advanced
542 pages
14h 24m
English
We need to initialize the DataSource with our custom schema, rather than with Spring Security's default schema. Update the DataSourceConfig.java file, as follows:
//src/main/java/com/packtpub/springsecurity/configuration/DataSourceConfig.java @Bean public DataSource dataSource() { return new EmbeddedDatabaseBuilder() .setName("dataSource") .setType(EmbeddedDatabaseType.H2) .addScript("/database/h2/calendar-schema.sql") .addScript("/database/h2/calendar-data.sql") .addScript("/database/h2/calendar-authorities.sql") .build(); }
Notice that we have removed all of the scripts that start with security, and replaced them with calendar-authorities.sql.
Read now
Unlock full access