db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <..@Bonn.IZ-Soz.de>
Subject Re: Re: Error: Could not parse or write data file referring to "<writeDataToDatabase datafile="data.xml"/>" - Fri, 26 Jan 2007 08:12:35 GMT
Date Fri, 26 Jan 2007 11:56:49 GMT
Hi Tom

Thanks for your answer:
you wrote on Fri, 26 Jan 2007:

>This is the relevant error: "java.net.MalformedURLException: unknown
>protocol: c".
>Apparently the JDBC url used for inserting the data is wrong, and thus
>DdlUtils cannot access the database. Please check it and see whether
>it matches the one used for the creation of the schema in the
>database.

Thanks for this hint, but I think I use the same JDBC url for the
creation of the schema and for inserting the data. Afterwards I tested
by another programme (DBVisualizer) that the new database
"issp_ddlutils_NewDb" has been created successfully with the correct
schema (tables etc.) but naturally without the data. 

Could you please look in the following at my complete "build.xml"
running by Ant. Is there an error in the <database url...> entry? 

<?xml version="1.0" encoding="UTF-8"?>
<project name="MigrateDatabaseToDerby" basedir=".">
   <path id="classpath">
      <fileset dir="./lib">
       	<include name="**/*.jar"/>
      </fileset>
   </path>
   <target name="export-source-db" description="Dumps db structure and
data">
      <taskdef name="databaseToDdl"
              classname="org.apache.ddlutils.task.DatabaseToDdlTask">
         <classpath refid="classpath"/>
      </taskdef>
      <databaseToDdl modelName="MigrateTest" verbosity="DEBUG"
schemapattern="ISSP">
      	  <database url="jdbc:derby:issp"
 
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"/>
         <writeSchemaToFile outputFile="db-schema.xml"/>
      	 <writeDataToFile outputFile="data.xml"
         	encoding="ISO-8859-1" determineschema="true"
failonerror="false"/>
      </databaseToDdl>
   </target>
	<target name="import-target-db" description="Creates db and
loads data">
	      <taskdef name="ddlToDatabase"
	
classname="org.apache.ddlutils.task.DdlToDatabaseTask">
	         <classpath refid="classpath"/>
	      </taskdef>
	      <ddlToDatabase schemaFile="project-schema.xml"
verbosity="DEBUG">
	         <database url="jdbc:derby:issp_ddlutils_NewDb"
	
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"/>
	         <createDatabase failonerror="false"/>
	         <writeSchemaToDatabase/>
	         <writeDataToDatabase datafile="data.xml"
usebatchmode="true" batchsize="1000" failonerror="false"/>
	      </ddlToDatabase>
	</target>
</project>



Kind regards

Siegfried Schomisch

----------------------------------------
Social Science Information Centre
Department Research & Development
Siegfried Schomisch, M.A. 
Lennestr. 30, D-53113 Bonn, Germany
Phone: (+49) 228 2281 168
Fax: (+49) 228 2281 120 
E-mail: sm@bonn.iz-soz.de
http://www.gesis.org/IZ/  
-----------------------------------


Mime
View raw message