@Bean public DataSource dataSource() { EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory(); factory.setDatabaseName("shinyproxy-social"); factory.setDatabaseType(EmbeddedDatabaseType.H2); factory.setDatabasePopulator(databasePopulator()); return factory.getDatabase(); }
@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(); }
@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(); }
@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(); }
@Bean(destroyMethod="shutdown") public DataSource dataSource() { EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory(); factory.setDatabaseName("greenhouse"); factory.setDatabaseType(EmbeddedDatabaseType.H2); return populateDatabase(factory.getDatabase()); }
@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(); }
public EmbeddedDatabase getDatabase() { EmbeddedDatabaseFactory databaseFactory = new EmbeddedDatabaseFactory(); databaseFactory.setDatabaseName("greenhouse"); databaseFactory.setDatabaseType(EmbeddedDatabaseType.H2); databaseFactory.setDatabasePopulator(populator); return databaseFactory.getDatabase(); }