Just to re-iterate, the task reports that the data is successfully inserted in the database. However, I do not see any data in any of the tables.
Thank you in advance! -- Anas Mughal -----Original Message----- From: Anas Mughal [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 29, 2008 10:35 AM To: '[email protected]' Subject: RE: Data not written to Oracle Thank you very much for taking the time to answer my question. By the way, the data successfully inserted by Jetspeed code. That code uses DDLUtils internally. So, my data file should not have any issues. Here is the output with DEBUG: >>> C:\workshop\DDLUtils\oracle>ant Buildfile: build.xml database-setup: [ddlToDatabase] Read schema file C:\workshop\DDLUtils\oracle\etc\schema\phase1-schema.xml [ddlToDatabase] Read schema file C:\workshop\DDLUtils\oracle\etc\schema\phase2-schema.xml [ddlToDatabase] Read schema file C:\workshop\DDLUtils\oracle\etc\schema\prefs-schema.xml [ddlToDatabase] Read schema file C:\workshop\DDLUtils\oracle\etc\schema\registry-schema.xml [ddlToDatabase] Read schema file C:\workshop\DDLUtils\oracle\etc\schema\security-schema.xml [ddlToDatabase] Borrowed connection [EMAIL PROTECTED] from data source [ddlToDatabase] Written data from file C:\workshop\DDLUtils\oracle\etc\sql\j2-seed.xml to database BUILD SUCCESSFUL Total time: 2 seconds <<< My ant script is as follows: >>> <?xml version="1.0" encoding="UTF-8"?> <project name="DDLUtilsTest" default="database-setup"> <property name="db-url" value="jdbc:oracle:thin:@localhost:1521:xe" /> <property name="db-driver" value="oracle.jdbc.driver.OracleDriver" /> <property name="db-username" value="bluenogTest" /> <property name="db-password" value="bluenog" /> <property name="db-schema-path" value="etc/schema/" /> <property name="db-data-file" value="etc/sql/j2-seed.xml" /> <path id="runtime-classpath"> <fileset dir="C:\Downloads\DDLUtils\DdlUtils-1.0-bin\lib"> <include name="**/*.jar" /> </fileset> <pathelement location="C:\Programs\DDLUtils/DdlUtils-1.0.jar" /> <pathelement location="C:\Programs\OracleJDBC/ojdbc14.jar" /> </path> <target name="database-setup" description="Creates the database structure and inserts data into the database"> <taskdef name="ddlToDatabase" classname="org.apache.ddlutils.task.DdlToDatabaseTask"> <classpath refid="runtime-classpath"/> </taskdef> <ddlToDatabase databasetype="oracle" usedelimitedsqlidentifiers="true" verbosity="DEBUG"> <database url="${db-url}" driverClassName="${db-driver}" username="${db-username}" password="${db-password}" /> <fileset dir="${db-schema-path}"> <include name="phase1-schema.xml" /> <include name="phase2-schema.xml" /> <include name="phase3ojb-schema.xmll" /> <include name="prefs-schema.xml" /> <include name="registry-schema.xml" /> <include name="security-schema.xml" /> </fileset> <!-- <createDatabase failonerror="false" /> --> <!-- <writeSchemaToDatabase /> --> <writeDataToDatabase datafile="${db-data-file}" /> </ddlToDatabase> </target> </project> <<< Thank you very much for your help! -- Anas Mughal W: 732-733-1120 x114 C: 862-571-2437 -----Original Message----- From: Thomas Dudziak [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 29, 2008 2:57 AM To: [email protected] Subject: Re: Data not written to Oracle On Mon, Apr 28, 2008 at 7:58 PM, Anas Mughal <[EMAIL PROTECTED]> wrote: > Looking thru the source code, I see that the method > DatabaseDataIO::writeDataToDatabase is called from WriteDataToDatabase > class. The implementation of DatabaseDataIO::writeDataToDatabase is: > > public void writeDataToDatabase(DataReader dataReader, String path) throws > DdlUtilsException { > try { > dataReader.parse(path); > } > catch (Exception ex) { throw new DdlUtilsException(ex); } > } > > The method apparently only reads the data. It does not seem to write > anything to the database. After calling this method, the code has a log > message that reports that data has been written to the database. No, it does not. It reads data from XML and puts it into a sink, which in this case is a database sink which inserts data into the DB (if it can). Please run your Ant task with a verbosity setting of DEBUG and post the output. Also if ensureforeignkeyorder is set to true (which is the default), please check your data for foreign keys where the referenced item is missing in the data XML (the output of the Ant task will print how many of these DdlUtils encountered). Tom
