Search in sources :

Example 1 with EmbeddedDatabase

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabase in project SpringStepByStep by JavaProgrammerLB.

the class DatabaseConfig method dataSource.

@Bean
public DataSource dataSource() {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript("sql/create-db.sql").addScript("sql/insert-data.sql").build();
    return db;
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) EmbeddedDatabase(org.springframework.jdbc.datasource.embedded.EmbeddedDatabase) Bean(org.springframework.context.annotation.Bean)

Example 2 with EmbeddedDatabase

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabase in project SpringStepByStep by JavaProgrammerLB.

the class DatabaseConfig method dataSource.

@Bean
public DataSource dataSource() {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).build();
    return db;
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) EmbeddedDatabase(org.springframework.jdbc.datasource.embedded.EmbeddedDatabase) Bean(org.springframework.context.annotation.Bean)

Example 3 with EmbeddedDatabase

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabase in project nikita-noark5-core by HiOA-ABI.

the class DemoDataSource method dataSource.

// Note: use the following string when accessing the database jdbc:h2:mem:n5DemoDb
@Bean
public DataSource dataSource() {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.H2).setName("n5DemoDb").build();
    return db;
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) EmbeddedDatabase(org.springframework.jdbc.datasource.embedded.EmbeddedDatabase) Bean(org.springframework.context.annotation.Bean)

Example 4 with EmbeddedDatabase

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabase in project nikita-noark5-core by HiOA-ABI.

the class DevDataSource method dataSource.

// Note: use the following string when checking database jdbc:h2:mem:n5DemoDb
@Bean
public DataSource dataSource() {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.H2).setName("n5DevDb").build();
    return db;
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) EmbeddedDatabase(org.springframework.jdbc.datasource.embedded.EmbeddedDatabase) Bean(org.springframework.context.annotation.Bean)

Example 5 with EmbeddedDatabase

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabase in project nikita-noark5-core by HiOA-ABI.

the class TestDataSource method dataSource.

// Note: use the following string when checking database jdbc:h2:mem:n5DemoDb
@Bean
public DataSource dataSource() {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.H2).setName("test").build();
    return db;
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) EmbeddedDatabase(org.springframework.jdbc.datasource.embedded.EmbeddedDatabase) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)5 EmbeddedDatabase (org.springframework.jdbc.datasource.embedded.EmbeddedDatabase)5 EmbeddedDatabaseBuilder (org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)5