On 9/18/07, Wessam Abd Rabo <[EMAIL PROTECTED]> 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