public DataSourcePool getDataSource(String name, DataSourceConfig dsConfig){ if (name == null){ throw new IllegalArgumentException("name not defined"); } synchronized(monitor){ DataSourcePool pool = dsMap.get(name); if (pool == null){ if (dsConfig == null){ dsConfig = new DataSourceConfig(); dsConfig.loadSettings(name); } pool = new DataSourcePool(this, name, dsConfig); dsMap.put(name, pool); } return pool; } }
public DataSourcePool getDataSource(String name, DataSourceConfig dsConfig){ if (name == null){ throw new IllegalArgumentException("name not defined"); } synchronized(monitor){ DataSourcePool pool = dsMap.get(name); if (pool == null){ if (dsConfig == null){ dsConfig = new DataSourceConfig(); dsConfig.loadSettings(name); } pool = new DataSourcePool(this, name, dsConfig); dsMap.put(name, pool); } return pool; } }
public void configureDbConfig(ServerConfig config) { Validate.notNull(config, "Config cannot be null"); DataSourceConfig ds = new DataSourceConfig(); ds.setDriver("org.sqlite.JDBC"); ds.setUrl("jdbc:sqlite:{DIR}{NAME}.db"); ds.setUsername("bukkit"); ds.setPassword("walrus"); ds.setIsolationLevel(TransactionIsolation.getLevel("SERIALIZABLE")); if (ds.getDriver().contains("sqlite")) { config.setDatabasePlatform(new SQLitePlatform()); config.getDatabasePlatform().getDbDdlSyntax().setIdentity(""); } config.setDataSourceConfig(ds); }
config.setName("iris"); DataSourceConfig ds = new DataSourceConfig(); ds.loadSettings("iris");
final DataSourceConfig dataSourceConfig = new DataSourceConfig(); dataSourceConfig.setDriver(Application.getConfiguration().getParameter("ebean.driver")); dataSourceConfig.setUsername(Application.getConfiguration().getParameter("ebean.username"));
dataSourceConfig = new DataSourceConfig();
dataSourceConfig = new DataSourceConfig();