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.4). 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 directory | Description |
samples/xquery |
This directory contains several subdirectories of examples showing the Bridge querying capabilities. |
+ W3C-use-cases-4R |
This directory contains a set of XQuery files ( xqbridge -q q4-xx.xqy
This command will print the query results on the standard output. The SQL instructions present in the |
samples/xquery/views |
This directory contains several subdirectories of examples showing the Bridge querying capabilities using XQuery views (functions). |
+ 1-XMP |
This directory contains a set of XQuery files ( xqbridge -q q1-xx.xqy
This command will print the query results on the standard output. The SQL instructions present in the |
+ 4-R |
This directory contains a set of XQuery files ( xqbridge -q q4-xx.xqy
This command will print the query results on the standard output. The SQL instructions present in the |
+ simple |
This directory contains a set of XQuery files ( xqbridge -q qxx.xqy
This command will print the query results on the standard output. The SQL instructions present in the |
samples/mapping |
Storage examples. |
+ 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 |
+ auction |
This directory contains another simple example based on an auction database, which is used in the provided XQuery samples. XML data can be stored in the database using the following command: xqbridge -i auction.map auction.xml
After this command has been executed, the database can be consulted to check that the data has been correctly inserted. Once this data is loaded, sample XQueries can also be executed without the need to set up the database using the provided SQL scripts. The SQL instructions present in the |
+ 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. Note that those generators must be compiled before running the samples. 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 |
+ 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 |
API examples. |
+ 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 name, the user password and the JDBC connection URL of the underlying database to be used. After the source code has been compiled, the example can be
executed using the run <query file>
|
+ 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>
|
+ 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
theApache 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 |