builder.createDatabase(database, dropTables); writer.close();
if ( alterDb ) { con = dataSource.getConnection(); builder.alterDatabase(database, con, doDrops, modifyColumns); } else { builder.createDatabase(database); }
    public void execute() throws BuildException    {        if (targetDatabase == null)         {            throw new BuildException( "Must specify a targetDatabase attribute" );        }        if (xmlFile == null)         {            throw new BuildException( "Must specify an xmlFile attribute" );        }        if (output == null)         {            throw new BuildException( "Must specify an output attribute" );        }                Database database = null;        try         {            database = loadDatabase();        }        catch (Exception e)         {            throw new BuildException( "Failed to parse file: " + getXmlFile(), e );                        }                FileWriter writer = null;        try         {            writer = new FileWriter( getOutput() );        }        catch (Exception e)         {            throw new BuildException( "Failed to create file: " + getOutput(), e );                        }                SqlBuilder builder = null;        try        {                    builder = newSqlBuilder(writer);        }        catch (Exception e)         {            throw new BuildException( "Failed to create SqlBuilder for database: " + getTargetDatabase(), e );                        }        if ( builder == null)        {            throw new BuildException( "Unknown database type: " + getTargetDatabase() );                        }                // OK we're ready now, lets try create the DDL        try         {            builder.createDatabase(database, dropTables);            writer.close();        }        catch (Exception e)         {            throw new BuildException( "Error occurred while writing to file: " + getOutput(), e );                        }    }