public Database createDatabase(Configuration config) { Database db = new InMemoryDatabase(); db.setConfiguration(config); return db; }
public Database createDatabase(Configuration config) { Database db = new KeyValueDatabase(); db.setConfiguration(config); return db; }
public Database getDatabase(int groupno, boolean overwrite) { Database thedb; if (groupno == 1) { if (database1 == null) // not set, so use default with is in memory database1 = new no.priv.garshol.duke.databases.InMemoryDatabase(); thedb = database1; } else if (groupno == 2) thedb = database2; // no default for no 2 else throw new DukeException("Can only have two databases"); if (thedb != null) { thedb.setConfiguration(this); thedb.setOverwrite(overwrite); // hmmm? } return thedb; }
public Database getDatabase(boolean overwrite) { database.setConfiguration(this); database.setOverwrite(overwrite); // hmmm? return database; }