Databases Reference
In-Depth Information
5.2.1
Loading data can be as simple as drag-and-drop
Most people are familiar with the concept of dragging and dropping to copy files from
one location to another. Adding data to a native
XML
database can be that easy.
Figure 5.3 shows how simple it can be to add new sales order data to an
XML
database.
You should note that you don't need to perform any entity-relational modeling
prior to loading your data. The metadata structures of an
XML
file will be used to cre-
ate all relevant indexes within the database. By default, every element is indexed for
immediate search, and each leaf element is treated as a string unless previously associ-
ated with a data type such as a decimal or date.
Native
XML
databases have many options to load data. For example, you can
Use an integrated
XML
IDE
such as the Eclipse-based oXygen
XML
editor with
built-in support for a native
XML
databases to upload a single file or a collection
of
XML
files. The oXygen
IDE
can be used as a standalone program or as an
Eclipse plug-in. Note: oXygen is a commercial product sold by SyncroSoft.
Use a command-line tool or a
UNIX
shell script to load data from a file on your
filesystem.
Use a build script and Apache Ant task to load data. Many native
XML
databases
come with Apache Ant extensions for all database operations.
Use an “uploader” web page that allows you to upload a local file into a remote
XML
database.
Use a backup-and-restore tool to load many
XML
files from an archive file.
Figure 5.3
Adding new sales order data to an XML database can be as easy as doing a drag-and-drop.
Many desktop operating systems such as Windows and Mac OS X support remote access using the
WebDAV protocol. This allows you to add new files to your XML database by dragging an XML file into
a database collection. All metadata associated with the XML file is used to index each element. As
soon as the file is added, the data can be immediately searched using XQuery. Data modeling is not
required before the data is added.