db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: Urgent: MalformedUrlException
Date Tue, 18 Sep 2007 16:06:14 GMT
On 9/18/07, Wessam Abd Rabo <wessam.abdrabo@gmail.com> wrote:

> The following piece of code creates a MalFormedUrl exception. I just read
> from an XML file and create a database. This is error Trace:
>
> org.apache.ddlutils.DdlUtilsException: java.net.MalformedURLException
>  at org.apache.ddlutils.io.DatabaseIO.read(DatabaseIO.java:172)
>
>
> This is the only code i write:
>
>  String  nameoffile= "xmltodb.xml";
>         Database targetModel = new DatabaseIO().read(nameoffile);
>
>         BasicDataSource dataSource = new BasicDataSource();
>         dataSource.setUrl("jdbc:derby://localhost:1527/instancedb");
>         dataSource.setDriverClassName("org.apache.derby.jdbc.ClientDriver");
>
>         boolean    alterDb = false;
>
>         Platform platform = PlatformFactory.createNewPlatformInstance
> (dataSource);
>
>         if (alterDb) {
>             platform.alterTables(targetModel, false);
>         } else {
>
>             platform.createTables(targetModel, true, true);
>         }

Try a different variant of the read method with e.g. a FileInputStream
that you opened for the xmltodb.xml file.

Tom

Mime
View raw message