Java 类org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory 实例源码

项目:shinyproxy    文件:SocialConfiguration.java   
@Bean
public DataSource dataSource() {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
    factory.setDatabaseName("shinyproxy-social");
    factory.setDatabaseType(EmbeddedDatabaseType.H2);
    factory.setDatabasePopulator(databasePopulator());
    return factory.getDatabase();
}
项目:Vaadin4Spring-MVP-Sample-SpringSecurity    文件:Application.java   
@Bean(destroyMethod = "shutdown")
public DataSource dataSource() {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
    factory.setDatabaseName("spring-vaadin-security-demo");
    factory.setDatabaseType(EmbeddedDatabaseType.H2);
    factory.setDatabasePopulator(databasePopulator());
    return factory.getDatabase();
}
项目:Vaadin4Spring-MVP-Sample-SpringSecuritySocial    文件:Application.java   
@Bean(destroyMethod = "shutdown")
public DataSource dataSource() {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
    factory.setDatabaseName("spring-social-showcase");
    factory.setDatabaseType(EmbeddedDatabaseType.H2);
    factory.setDatabasePopulator(databasePopulator());
    return factory.getDatabase();
}
项目:javaconfig-ftw    文件:MainConfig.java   
@Bean(destroyMethod = "shutdown")
public DataSource dataSource() {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
    factory.setDatabaseName("spring-social-showcase");
    factory.setDatabaseType(EmbeddedDatabaseType.H2);
    factory.setDatabasePopulator(databasePopulator());
    return factory.getDatabase();
}
项目:inmapper-ws    文件:ApplicationSpringConfig.java   
@Bean
public DataSource dataSource() throws ClassNotFoundException {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();

    factory.setDatabasePopulator(new ResourceDatabasePopulator());
    factory.setDatabaseName(DATABASE_NAME);
    factory.setDatabaseConfigurer(H2FileEmbeddedDatabaseConfigurer.getInstance());

    return factory.getDatabase();
}
项目:spring-greenhouse-clickstart    文件:DataConfig.java   
@Bean(destroyMethod="shutdown")
public DataSource dataSource() {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
    factory.setDatabaseName("greenhouse");
    factory.setDatabaseType(EmbeddedDatabaseType.H2);
    return populateDatabase(factory.getDatabase());     
}
项目:spring-greenhouse-clickstart    文件:GreenhouseDatabaseInstallerTest.java   
@Test
public void runUpgrader() {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
    factory.setDatabaseType(EmbeddedDatabaseType.H2);
    EmbeddedDatabase db = factory.getDatabase();
    System.setProperty("security.encryptPassword", "foo");
    System.setProperty("security.encryptSalt", new String(Hex.encode(KeyGenerators.secureRandom().generateKey())));
    DatabaseUpgrader installer = new DatabaseUpgrader(db, new StandardEnvironment(), Encryptors.noOpText());
    installer.run();
    installer.run();
    DatabaseUpgrader installer2 = new DatabaseUpgrader(db, new StandardEnvironment(), Encryptors.noOpText());
    installer2.run();
}
项目:spring-greenhouse-clickstart    文件:GreenhouseTestDatabaseBuilder.java   
public EmbeddedDatabase getDatabase() {
    EmbeddedDatabaseFactory databaseFactory = new EmbeddedDatabaseFactory();
    databaseFactory.setDatabaseName("greenhouse");
    databaseFactory.setDatabaseType(EmbeddedDatabaseType.H2);
    databaseFactory.setDatabasePopulator(populator);        
    return databaseFactory.getDatabase();
}