This directory contains examples of use for XQuark Bridge. The directory for each individual example generally contains:
load.sql
file, used to create the relational
schema
and insert relational data (if required). This file can be loaded
using your favorite RDBMS command-line utility. This script is written
using the most portable syntax, however if an alternate script is not
provided for your RDBMS (check for load_rdbms.sql files) you may need
to adjust it by yourself.build.xml
file used to compile the example, plus any
support file required to run the example.Note that all the source files have been compiled using Ant (version 1.5.3). Any other build tool should work as well, but you will need to write your own build file.
The command-line examples given below assume that the XQuark Bridge command-line tool has been properly configured, as detailed in the installation guide.
Example | Description |
samples/xquery |
This directory contains a set of XQuery files ( xqbridge -q q4-xx.zql
This command will print the query results on the standard output. The SQL instructions present in the |
samples/mapping/basic |
This directory contains an example based on a purchase order schema, together with a basic mapping to store XML data in relational columns, without storing any relations between document elements. XML data can be stored in the database using the following command: xqbridge -i po.map po1.xml
After this command has been executed, the database can be consulted to check that the data has been correctly inserted. The SQL instructions present in the |
samples/mapping/purchaseOrder |
This directory contains a more complex example based on the same purchase order schema, but using a complex mapping to store both XML data in relational columns and relations between document elements. This example also uses user-defined generators to generate internal primary keys while storing the document content. This example can be executed by using the following command: xqbridge -i po.map po1.xml
After this command has been executed, the database can be consulted to check that the data has been correctly inserted. The SQL instructions present in the |
samples/mapping/references |
This directory contains a mapping example showing how to use the mapping directives to implement data transcoding based on reference tables. This example can be executed by using the following command: xqbridge -i product.map product.xml
After this command has been executed, the database can be consulted to check that the data has been correctly inserted. The SQL instructions present in the |
samples/xdbc/querier1 |
This example is provided as an illustration of the use of the
XML/DBC API. It creates a very simple application which reads a query
from a file, executes it and prints the query results on the standard
output.
The Main.java source should be adapted to your environnement. You should modify the user identifier, the user password, the connction JDBC URL of the underlying database and also the schema to be used. After the source code has been compiled, the example can be
executed using the run <query file>
|
samples/xdbc/querier2 |
This example is provided as an illustration of the use of the
XML/DBC API. It creates a very simple application which reads a query
from a file, executes it and prints the query results on the standard
output.
A configuration file After the source code has been compiled, the example can be
executed using the run <query file>
|
samples/xdbc/mapper |
This example is provided as an illustration of the use of the
mapping API. It creates a very simple application which stores an XML
document in the database, based on the specified mapping file.
Database access is hard-coded in the source code and will probably need to be updated for the example to run correctly. After the source code has been compiled, the example can be
executed using the run <map file> <xml file>
|
samples/xdbc/servlet |
This example is provided as an illustration of the use of the
API within a simple servlet. It creates a simple Web application which
can either store an XML document in the database, based on some
predefined mapping files, or issue an XQuery and produce an XML
document.
This example can be deployed as a standard Web application in
the
Apache Tomcat Web server. The location of the Web server deployment
directory must be specified by setting the After the source code has been compiled and deployed (using
the 'compile' and 'deploy' ant tasks), be sure to add your favourite
DBMS JDBC driver in the lib folder under the Tomcat 'xqbridge'
application folder (avoid .zip files, use .jar). The example can be run using the following URL (assuming Tomcat is running locally in its standard configuration): http://localhost:8080/xqbridge
Note: You will need to execute the |