1.1

Table Of Contents
-url=jdbc:mysql://localhost:3306/sqlfdb?user=username&password=password
7.
Use the sqlf write-data-to-db command and specify both the data XML le and the schema XML
le to import the data to SQLFire:
sqlf write-data-to-db -files=mysql-data.xml -schema-files=mysql-schema.xml
-client-bind-address=localhost -client-port=1527
8. If necessary, manually add triggers, views, and Java stored procedures in the SQLFire database.
Using Apache DdlUtils to Import Data
The SQLFire installation includes Apache DdlUtils 1.1, and you can use DdlUtils in combination with Apache
Ant to import data into SQLFire. The information in these sections is intended for customers who are familiar
with DdlUtils and want to use DdlUtils in place of the available sqlf commands.
Overview of DdlUtils
DdlUtils is a small, easy-to-use component for working with Database Denition (DDL) les.
DdlUtils is an Apache project. Use it to:
Generate DDL scripts from an existing database by using Ant tasks or a Java API.
Export and import data to/from XML from an supported database to another supported database (including
SQLFire).
Take XML les that contain the denition of a database schema, for example, tables and columns. These les
can be fed into DdlUtils through its Ant task or programmatically in order to create the corresponding database
or alter it so that it corresponds to the DDL. Likewise, DdlUtils can generate a DDL le for an existing database.
Note: The instructions in this section use a version of DdlUtils that has been modied to support SQLFire
and its SQL dialect. This version of DdlUtils is installed with SQLFire, and is available in the
vFabric_SQLFire_11_bNNNNN/lib/ddlutils directory. Ensure that you use the installed
version of DdlUtils, rather than the standard Apache version, when performing the instructions.
A common usage pattern with SQLFire is as a database cache in front of a relational data store. DdlUtils provides
a way to export the schema denition from a relational database as a SQL script so the developer can tailor it
for partitioning and replication and then import the schema into SQLFire.
DdlUtils can optionally be used to export from an external database and import the same into SQLFire.
Note: If you attempt to export and import data that includes auto-generated primary key columns, the
data row import fails. SQLFire adds distributed system data into generated keys, and this precludes
referencing those generated keys by subsequent imported data rows.
Export, Alter, and Import a Database Schema Using DdlUtils
Use DdlUtils to export, modify, and import data.
Procedure
1. Download and install Apache Ant if it is not already available on your system.
2. Ensure that your CLASSPATH includes the JAR le that contains the third-party database's JDBC driver.
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.
99
Exporting and Importing Data with vFabric SQLFire