1.1.1

Table Of Contents
3. Read the available DdlUtils documentation to understand the various Ant tasks. Documentation is installed
in the ddlutils/DdlUtils-1.0-doc.zip le and is also available at the DdlUtils project site. This
step is not required if you only want to export DDL from a schema and then apply it to SQLFire.
4. Make sure that you can connect to the external database and to SQLFire servers. You will need to supply the
connection URL and properties for both databases when using DdlUtils.
5.
Edit the build.xml le in the ddlutils/example directory to specify the JDBC connection information
for both SQLFire and the database from which you are importing data. The example build le contains sample
entries for SQLFire and MySQL. You will need to change each occurrence of the JDBC URLs. The
build.xml contents are shown in the Example build.xml File on page 102.
6.
By default, the usedelimitedsqlidentifiers property is set to false, which means that tables,
columns, and other object names are simple references with no need to place the names in quotation marks.
However, if your schema contains table or column names with embedded spaces, change this property to
"true" and use single quotation marks around the table and column names each time you reference them.
7. Databases such as Oracle 11g contain system tables with data types that are incompatible with the DdlUtils
1.1 API. To export schemas or data from these databases, you must use the schemapattern property to
exclude schemas that contain incompatible data types.
8.
In the ddlutils/example directory, run the following command to run the three Ant tasks that generate
a SQL DDL script that is compatible with SQLFire syntax:
ant writeDDLToXML createDBFromXML writeDDLToSQL
9.
Edit the CREATE TABLE statements in the resulting script to use SQLFire-specic clauses. For example
use syntax to use colocation for partitioning, persist tables, associate tables with gateways, and so forth.
10.
Use the sqlf utility to run the modied script in SQLFire. For example:
sqlf
connect client 'localhost:1527';
run 'db-schema1.sql';
exit;
11.
To import data from the database, use the ImportDataToDB target in the example build.xml le.
12. If necessary, manually add triggers, views, and Java stored procedures in the SQLFire database.
Example build.xml File
View a sample build le for using DdlUtils with SQLFire.
<?xml version="1.0"?>
<project name="test" default="writeDDLToXML" basedir=".">
<path id="runtime-classpath">
<fileset dir="../dist">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<fileset dir="../lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<!-- This will output all the object in the database 'test' and output the
schema definition
to a file 'db-schema1.xml'. This will also extract the data and output
this to 'data.xml'
-->
<target name="writeDDLToXML" description="Dumps the database structure">
<taskdef name="databaseToDdl"
vFabric SQLFire User's Guide102
Managing Your Data in vFabric SQLFire