package com.intrbiz.balsa.demo.todo;

import org.postgresql.Driver;

import com.intrbiz.balsa.BalsaApplication;
import com.intrbiz.balsa.demo.todo.db.TodoListDB;
import com.intrbiz.data.DataManager;
import com.intrbiz.util.pool.database.DatabasePool;

public class App extends BalsaApplication
{
    @Override
    protected void setup() throws Exception
    {
        // Setup the application routers
        router(new TodoUI());
        router(new MetricsUI());
        // setup the database
        DataManager.getInstance().registerDefaultServer(DatabasePool.Default.create(Driver.class, "jdbc:postgresql://127.0.0.1/todo", "todo", ""));
        // ensure the database is installed and upgraded
        TodoListDB.install();
    }
    
    public static void main(String[] args) throws Exception
    {
        App app = new App();
        app.start();
    }
}

@@ -35,39 +35,8 @@
 o;%0A%0A
-import org.postgresql.Driver;%0A%0A
 impo
@@ -326,112 +326,8 @@
   %7B%0A
-        // Setup the application routers%0A        router(new TodoUI());%0A        router(new MetricsUI());%0A
     
@@ -433,29 +433,32 @@
 ult.
-create(Driver.class, 
+with().postgresql().url(
 %22jdb
@@ -491,20 +491,150 @@
 odo%22
-, %22todo%22, %22%22
+).username(%22todo%22).password(%22%22).build());%0A        // Setup the application routers%0A        router(new TodoUI());%0A        router(new MetricsUI(
 ));%0A

Refactor database setup