Search in sources :

Example 41 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder 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 42 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder 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 43 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder 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)

Example 44 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project spring-integration by spring-projects.

the class JdbcMessageHandlerIntegrationTests method setUp.

@BeforeClass
public static void setUp() {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    builder.setType(EmbeddedDatabaseType.HSQL).addScript("classpath:org/springframework/integration/jdbc/messageHandlerIntegrationTest.sql");
    embeddedDatabase = builder.build();
    jdbcTemplate = new JdbcTemplate(embeddedDatabase);
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) BeforeClass(org.junit.BeforeClass)

Example 45 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project spring-integration by spring-projects.

the class StoredProcMessageHandlerDerbyIntegrationTests method setUp.

@BeforeClass
public static void setUp() throws SQLException {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    builder.setType(EmbeddedDatabaseType.DERBY);
    builder.addScript("classpath:derby-stored-procedures.sql");
    embeddedDatabase = builder.build();
    jdbcTemplate = new JdbcTemplate(embeddedDatabase);
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) BeforeClass(org.junit.BeforeClass)

Aggregations

EmbeddedDatabaseBuilder (org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)67 Before (org.junit.Before)17 JdbcTemplate (org.springframework.jdbc.core.JdbcTemplate)15 EmbeddedDatabase (org.springframework.jdbc.datasource.embedded.EmbeddedDatabase)15 JndiRegistry (org.apache.camel.impl.JndiRegistry)11 Bean (org.springframework.context.annotation.Bean)9 JdbcPropertyStore (org.ff4j.property.store.JdbcPropertyStore)5 FeatureStoreSpringJdbc (org.ff4j.springjdbc.store.FeatureStoreSpringJdbc)5 JdbcFeatureStore (org.ff4j.store.JdbcFeatureStore)5 JdbcQueryBuilder (org.ff4j.store.JdbcQueryBuilder)4 Test (org.junit.Test)4 PropertyStoreSpringJdbc (org.ff4j.springjdbc.store.PropertyStoreSpringJdbc)3 BeforeClass (org.junit.BeforeClass)3 Test (org.junit.jupiter.api.Test)3 PreparedStatement (java.sql.PreparedStatement)2 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)2 JdbcEventRepository (org.ff4j.audit.repository.JdbcEventRepository)2 Connection (java.sql.Connection)1 Map (java.util.Map)1 Properties (java.util.Properties)1