Information Technology Reference
In-Depth Information
QA. Using this process, you can simply type ant db:prepare 2 from
the command line and the build process will perform the tasks outlined
in Table 5-1. If you'd like to see this same process using other tools,
like NAnt or Maven, we've provided additional examples at the topic's
associated Web site. 3
LISTING 5-1
build-database.xml: Automating Database Integration
Using Ant
> ant -f build-database.xml db:prepare
Buildfile: build-database.xml
db:create:
[sql] Executing file: data-definition.sql
[sql] 8 of 8 SQL statements executed successfully
db:insert:
[sql] Executing file: data-manipulation.sql
[sql] 60 of 60 SQL statements executed successfully
BUILD SUCCESSFUL
Total time: 20 seconds
As you can see, using a single instruction from the command line
enables the execution of SQL scripts that define ( db:create ) and
manipulate a database ( db:insert ). We describe each of these tasks in
more detail in subsequent sections.
Figure 5-2 shows the steps to automate your database integration.
The following sections present a discussion of each component in
Figure 5-2.
Creating Your Database
To automate database integration, you must first create a database. In
this script, you typically drop and recreate the database, enforce data
integrity through constraints and triggers, and define database behav-
2. To manage other environments from the command line, incorporate a feature
into your build script to override the default configuration. For instance, in Ant
this would be ant -Denvironment=devqa <targetname> .
3. At www.integratebutton.com/.
Search WWH ::




Custom Search