In this section, you extract elements from an XML Order document and store them in the rows and columns of the Orders tables. The examples illustrate this procedure in both server and client environments.
You translate the elements using the Java method order2Sql( ) of the OrderXml class. Assume that xmlOrder is a Java variable of type OrderXml: xmlOrder.order2Sql(“orders_received”, “antibes:4000?user=sa”);
The order2Sql() call extracts the elements of the XML Order document contained in variable xmlOrder, and then uses JDBC operations to insert that data into the orders_received table. You can call this method on the client or on Adaptive Server:
Invoked from the client, order2Sql() extracts the elements of the XML Order document in the client, uses jConnect to connect to the Adaptive Server, and then uses the Transact-SQL insert command to place the extracted data into the table.
Invoked from the server, order2Sql() extracts the elements of the XML Order document in the Adaptive Server, uses the native JDBC driver to connect to the current Adaptive Server, and then use the Transact-SQL insert command to place the extracted data into the table.