You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Hacking Bear <ha...@gmail.com> on 2008/05/25 01:55:05 UTC
No output from writeSchemaSqlTofile command
Hi,
I'm new to dbUtils and i cannot find answers to my question. Please help me.
I want to export my schema to SQL DDL from SQL Server but the output sql
file is empty (even though the XML schema file has valid data.) Apparently,
my task, connection, etc. works. Only the generated SQL file is empty. any
idea?
Thanks!
My Ant task is
<target name="db-dump" description="Dumps the database structure">
<taskdef name="databaseToDdl"
classname="org.apache.ddlutils.task.DatabaseToDdlTask">
<classpath refid="runtime-classpath"/>
</taskdef>
<databaseToDdl modelName="ss" schemapattern="dbo" verbosity="debug"
databaseType="mssql">
<database url="jdbc:sqlserver://localhost:1433;DatabaseName=avop"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
username="sa"
password="sa"/>
<writeSchemaToFile outputFile="ss-schema.xml"/>
<writeSchemaSqlToFile outputFile="ss.sql"/>
</databaseToDdl>
</target>
running from cygwin bash:
$ ant -lib dist -lib lib ; ls -l *.xml *.sql
Buildfile: build.xml
db-dump:
[databaseToDdl] May 24, 2008 4:50:56 PM
com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
[databaseToDdl] WARNING: Failed to load the sqljdbc_auth.dll
[databaseToDdl] Borrowed connection
org.apache.commons.dbcp.PoolableConnection@54a328 from data source
[databaseToDdl] Returning connection
org.apache.commons.dbcp.PoolableConnection@54a328 to data source.
[databaseToDdl] Remaining connections: None
[databaseToDdl] Written schema to d:\dbutils\ss-schema.xml
[databaseToDdl] Borrowed connection
org.apache.commons.dbcp.PoolableConnection@54a328 from data source
[databaseToDdl] Returning connection
org.apache.commons.dbcp.PoolableConnection@54a328 to data source.
[databaseToDdl] Remaining connections: None
[databaseToDdl] Written schema SQL to d:\dbutils\ss.sql
BUILD SUCCESSFUL
Total time: 7 seconds
---------- 1 me mkpasswd 49959 May 24 16:51 ss-schema.xml
---------- 1 me mkpasswd 0 May 24 16:51 ss.sql
Re: No output from writeSchemaSqlTofile command
Posted by Thomas Dudziak <to...@gmail.com>.
On Sat, May 24, 2008 at 4:55 PM, Hacking Bear <ha...@gmail.com> wrote:
> I'm new to dbUtils and i cannot find answers to my question. Please help me.
>
> I want to export my schema to SQL DDL from SQL Server but the output sql
> file is empty (even though the XML schema file has valid data.) Apparently,
> my task, connection, etc. works. Only the generated SQL file is empty. any
> idea?
That is odd. Could you try running the writeSchemaSqlToFile subtask
within the ddlToDatabase task using the ss-schema.xml file that you
got ? That will basically perform the same operation except that it
does not use a live database but the database model contained in the
ss-schema.xml file.
Tom