db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Obs <obb...@gmail.com>
Subject MSSQL, ANT Tasks, Identity insert
Date Fri, 14 Jul 2006 13:24:48 GMT
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)

Since that does that, I think it's causing the IDENTITY_INSERT feature to
not work.


-- 
Obs

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