You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by sm...@Bonn.IZ-Soz.de on 2007/01/26 12:56:49 UTC

Re: Re: Error: Could not parse or write data file referring to "" - Fri, 26 Jan 2007 08:12:35 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/  
-----------------------------------


Re: Re: Error: Could not parse or write data file referring to "" - Fri, 26 Jan 2007 08:12:35 GMT

Posted by Thomas Dudziak <to...@gmail.com>.
On 1/26/07, sm@bonn.iz-soz.de <sm...@bonn.iz-soz.de> wrote:ip>

> 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?

<snip>

Mhmm, I have no idea what the problem is. I ran your build file using
a fairly complex model and some data, and it worked just fine. Perhaps
you could try a different Derby version ?

Tom