I'm doing this in eclipse but the derby is the network server flavor, not
the embedded one. The output from ant is:
Buildfile: C:\users\rusty\workspace\products\build-ddl.xml
init:
database-setup:
[ddlToDatabase] Read schema file
C:\users\rusty\workspace\products\src\main\resources\ddl\products.xml
BUILD FAILED
C:\users\rusty\workspace\products\build-ddl.xml:12: Could not get a
connection from the datasource
Total time: 1 second
Here's my build-ddl.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project default="database-setup">
<target name="init">
<taskdef
name="ddlToDatabase"
classname="org.apache.ddlutils.task.DdlToDatabaseTask"
/>
</target>
<target name="database-setup" depends="init">
<ddlToDatabase>
<database
driverClassName="org.apache.derby.jdbc.ClientDriver"
url="jdbc:derby://localhost:1527/products"
/>
<fileset dir="src/main/resources/ddl">
<include name="products.xml" />
</fileset>
<writeSchemaToDatabase
failonerror="true"
alterdatabase="true"
/>
</ddlToDatabase>
</target>
</project>
I can connect to derby using the url above using the "ij" interactive
command line sql thing in eclipse.
When I start derby in eclipse its console says:
Apache Derby Network Server - 10.2.2.0 - (485682) started and ready to
accept connections on port 1527 at 2007-04-24 04:16:32.784 GMT
Here is my products.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE database PUBLIC "database"
"http://db.apache.org/torque/dtd/database.dtd">
<database name="products">
<table name="products">
<column
name="sku"
type="VARCHAR"
primaryKey="true"
required="true"
/>
<column
name="name"
type="VARCHAR"
required="true"
/>
</table>
</database>
Ant never seems to get a connection to derby; I can see that derby isn't
creating the directory and database like it does when I do the command at
the ij prompt.
Thanks for your help.