Exemple #1
0
  private void setupDatabase() {
    Configuration config = getConfig();

    database =
        new MyDatabase(this) {
          protected java.util.List<Class<?>> getDatabaseClasses() {
            List<Class<?>> list = new ArrayList<Class<?>>();
            list.add(DBVersion.class);
            list.add(Cooldown.class);

            return list;
          };
        };

    database.initializeDatabase(
        config.getString("database.driver", "org.sqlite.JDBC"),
        config.getString("database.url", "jdbc:sqlite:{DIR}{NAME}.db"),
        config.getString("database.username", "bukkit"),
        config.getString("database.password", "walrus"),
        config.getString("database.isolation", "SERIALIZABLE"),
        config.getBoolean("database.logging", false),
        config.getBoolean("database.rebuild", false));

    config.set("database.rebuild", false);
  }
Exemple #2
0
 @Override
 public EbeanServer getDatabase() {
   return database.getDatabase();
 }