You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@db.apache.org by Philip Mark Donaghy <ph...@gmail.com> on 2005/11/21 16:08:47 UTC

The ddlToDatabase task

The documentation for the ddlToDatabase task says to use the sub
element dataSource yet the example says to use,

<database url="jdbc:postgresql://localhost/test"
              driverClassName="org.postgresql.Driver"
              username="someuser"
              password="somepassword"/>

I am asking this because when I use dataSource it is not accepted and
when I use database I get the error,
"org.apache.ddlutils.DynaSqlException: Could not get a connection from
the datasource". I am using the configuration

        <taskdef name="ddl"
classname="org.apache.ddlutils.task.DdlToDatabaseTask"
description="The task used to create a ddl from the datamodel xml."
classpathref="commons-sql.runtime.classpath" />
        <ddl schemaFile="${output}" databaseType="${targetDatabase}">
            <database url="jdbc:derby:build"
                      driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
                      username=""
                      password=""/>
            <writeSchemaSqlToFile outputFile="${ddl}" />
        </ddl>

I tried a couple of things I changed driverClassName to
EmbeddedDataSource. I tried including the createDatabase subtag.

Any clues?

Philip


--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy
connection.oreilly.com/users/profile.public.php?user_id=4371
www.linkedin.com/profile?viewProfile=&key=1811119 www.capferret.org
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62