Create App2.java

This commit is contained in:
josephine-barboza 2018-09-28 06:20:22 +05:30 committed by GitHub
parent 9510ca6fa1
commit 8b8e3f2650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package com.baeldung.ebean.app;
import java.util.Properties;
import io.ebean.EbeanServer;
import io.ebean.EbeanServerFactory;
import io.ebean.config.ServerConfig;
public class App2 {
public static void main(String[] args) {
ServerConfig cfg = new ServerConfig();
cfg.setDefaultServer(true);
Properties properties = new Properties();
properties.put("ebean.db.ddl.generate", "true");
properties.put("ebean.db.ddl.run", "true");
properties.put("datasource.db.username", "sa");
properties.put("datasource.db.password", "");
properties.put("datasource.db.databaseUrl", "jdbc:h2:mem:app2");
properties.put("datasource.db.databaseDriver", "org.h2.Driver");
cfg.loadFromProperties(properties);
EbeanServer server = EbeanServerFactory.create(cfg);
}
}