db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Obs <obb...@gmail.com>
Subject Re: MSSQL, ANT Tasks, Identity insert
Date Fri, 14 Jul 2006 14:57:43 GMT
I guess my follow up question would be, how does the model get set for the
DdlToDatabaseTask?  I figured it would get ot from the
WriteDataToDatabaseCommand where you set the file to be read in


On 7/14/06, Thomas Dudziak <tomdzk@gmail.com> wrote:
>
> 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
>



-- 
Obs

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message