db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: MSSQL, ANT Tasks, Identity insert
Date Fri, 14 Jul 2006 14:03:54 GMT
On 7/14/06, Obs <obbers@gmail.com> wrote:
> WriteDataToDatabaseCommand wdtd = new WriteDataToDatabaseCommand();
> wdtd.setFailOnError(true);
> wdtd.setDataFile(a);
> wdtd.setEnsureForeignKeyOrder(true);
> wdtd.setUseBatchMode(true);
> wdtd.setBatchSize(100);
> //Build task
> DatabaseToDdlTask in = new DatabaseToDdlTask();
> in.setUseDelimitedSqlIdentifiers(true);
> in.addConfiguredDatabase(dcs.convertToBasicDataSource(destds));
> in.addWriteDataToDatabase(wdtd);
> in.execute();
>
> Notice Im using the DatabaseToDdl task instead of the DdlToDatabase task,
> except I'm loading data into the database from a previously generated xml.
> If I try it from the DdlToDatabase task, I get
>
> No database model specified
>     at org.apache.ddlutils.task.DatabaseTaskBase.executeCommands(
> DatabaseTaskBase.java:212)
>     at org.apache.ddlutils.task.DatabaseTaskBase.execute(
> DatabaseTaskBase.java:242)
>     at com.creative.db.DatabaseTest.readFromDatabase(DatabaseTest.java:109)
>     at com.creative.db.DatabaseCopy.main(DatabaseCopy.java:15)

You need a database model (i.e. tables etc.) because data is expressed
in terms of tables, columns etc. You can either read the model from
the database or specify an XML file.

Tom

Mime
View raw message