Information Technology Reference
In-Depth Information
Database Integration
Some people consider the source code integration and integration of
the database as completely separate processes— always performed by
different groups. This is unfortunate because the database (if you are
using one on your project) is an integral part of the software applica-
tion. By using a CI system, you can ensure the integration of a database
through a single source: your version control repository.
Figure 1-5 demonstrates enabling continuous database integration
in the build process of a CI system. We treat the database source
code—Data Definition Language (DDL) scripts, Data Manipulation
Language (DML) scripts, stored procedure definitions, partitioning,
and so on—in the same manner as any other source code in the system.
For instance, when a project member (developer or DBA, for instance)
modifies a database script and commits it to the version control sys-
tem, the same build script that integrates source code will rebuild the
database and data as part of the integration build process.
Listing 1-6 demonstrates how to drop and create a MySQL data-
base using Ant's sql task. There is much more you will do to rebuild
your database and test data. This example hard-codes many values for
demonstration purposes.
LISTING 1-6 MySQL and Ant
<target name="db:create-database”>
<sql driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/"
userid="root"
password="sa"
classpathref="db.lib.path"
delimiter=";">
<fileset file="${database.dir}/drop-database.sql"/>
<fileset file="${database.dir}/create-database.sql "/>
</sql>
</target>
We demonstrate examples, approaches, and the benefits of data-
base integration in Chapter 5 .
Search WWH ::




Custom Search