db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin van den Bemt (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DDLUTILS-45) createDatabase and alterDatabase should give access to the generated SQL.
Date Tue, 08 Nov 2005 20:40:20 GMT
    [ http://issues.apache.org/jira/browse/DDLUTILS-45?page=comments#action_12357072 ] 

Martin van den Bemt commented on DDLUTILS-45:
---------------------------------------------

This is already possible :

        Platform platform = PlatformFactory.createNewPlatformInstance(databaseType);
        StringWriter writer = new StringWriter();
        platform.getSqlBuilder().setWriter(writer);
        Database source = null;
        try {
            source = platform.getModelReader().getDatabase(getConnection());
        } catch (SQLException e1) {
            e1.printStackTrace();
        }
        try {
            platform.getSqlBuilder().alterDatabase(source, database, false, true);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("sql : \n"+writer.getBuffer());



> createDatabase and alterDatabase should give access to the generated SQL.
> -------------------------------------------------------------------------
>
>          Key: DDLUTILS-45
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-45
>      Project: DdlUtils
>         Type: Improvement
>     Reporter: Thorbjørn Ravn Andersen
>     Assignee: Thomas Dudziak
>     Priority: Minor
>  Attachments: sql-access.txt
>
> In a scenario where you work with XML-representations of databases, you do not necessarily
want to first create the first schema in a database, and then alter to the second to see how
it works.
> It would be quite suitable just to work on the models loaded from XML and then just generate
the corresponding SQL without executing it.
> This would provide for debugging and documentation purposes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message