Translating data from an XML order into SQL

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: