Configuring dbdeploy for Ant
Configuration requires aditing your project build file - by default this will be called build.xml.
Ensure that dbdeploy.jar is included in your classpath.
First you need to include an ant taskdef, to do this include the following line in build.xml
<taskdef name="dbdeploy" classname="net.sf.dbdeploy.AntTarget"/>
Next include a call to the dbdeploy task in the relevant database target, for example:
<dbdeploy
driver="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:hsql://localhost/xdb"
userid="sa"
password="s3cur1ty"
dir="${basedir}\db\deltas"
outputfile="${basedir}\build\output\all-deltas.sql"
dbms="hsql"
undoOutputfile="${basedir}\build\output\undo-all-deltas.sql"
/>
The parameters are as follows:
| Attribute | Description | Required |
| driver | Specifies the jdbc driver. | Yes |
| url | Specifies the url of the database that the deltas are to be applied to. | Yes |
| userid | The ID of a dbms user who has permissions to select from the schema version table. | Yes |
| password | The password of the dbms user who has permissions to select from the schema version table. | Yes |
| dir | Full or relative path to the directory containing the delta scripts. | Yes |
| outputfile | The name of the script that dbdeploy will output. Include a full or relative path. | Yes |
| dbms | The target dbms. Valid values are: ora -> Oracle syb-ase -> Sybase ASE hsql -> Hypersonic SQL mssql -> MS SQL Server mysql -> MySQL Database |
Yes |
| undoOutputfile | The name of the undo script that dbdeploy will output. Include a full or relative path. | No |
| maxNumberToApply | The highest numbered delta script to apply. | No |
| deltaSet | A tag used to identify a grouping of delta scripts - useful if you need to separate DDL and DML when deploying to replicated environments. If not supplied defaults to "Main" |
No |