November 2017
Intermediate to advanced
542 pages
14h 24m
English
To configure the H2 embedded database, we need to create a DataSource and run SQL to create the Spring Security table structure. We will need to update the SQL that is loaded at startup to include Spring Security's basic schema definition, Spring Security user definitions, and the authority mappings for users. You can find the DataSource definition and the relevant updates in the following code snippet:
//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") ...Read now
Unlock full access