In this example, Java methods generate an XML Order document from the SQL data in the tables created in “Creating and populating SQL tables for order data”.
A constructor method of the OrderXml class maps the data. An example call of that constructor might be:
new xml.order.OrderXml("990704", "123",
"antibes:4000?user=sa");
This constructor method uses internal JDBC operations to:
Execute a SQL query for the order data
Generate an XML Order document with the data
Return the OrderXml object that contains the Order document
You can invoke the OrderXml constructor in the client or the Adaptive Server.
If you invoke the OrderXml constructor in the client, the JDBC operations that it performs use jConnect to connect to the Adaptive Server and perform the SQL query. It then reads the result set of that query and generates the order document on the client.
If you invoke the OrderXml constructor in Adaptive Server, the JDBC operations that it performs use the native JDBC driver to connect to the current Adaptive Server and perform the SQL query. It then reads the result set and generates the Order document in Adaptive Server.