
CustomerXSL | XML | XMLToSQL | |
ProduceDOMDoc.. | Document | ||
| |||
<Customer> | <SQLResult> |
| |
<firstname> |
| ||
IT | <{$COLUMN}> | SQLToXML | |
</firstname> | value | ||
| |||
. | </{$COLUMN}> |
| |
. | . |
| |
. |
| ||
</Customer> | </SQLResult> |
|
Figure 11-4 Converting an XML Document
11.3.3 XMLToSQL architecture
The XMLToSQL takes one parameter to initialize. That parameter is SQLProperty class and it contains following data:
JdbcDriver | JDBC Driver name |
LoginId | Database login id |
Password | Database login password |
JdbcServer | Server name (ex. jdbc:db2:Airline) |
Schema | Set Schema if it is different |
Action | INSERT or UPDATE |
Tip: What is the schema? When you use SELECT * from db2admin.employee, db2admin is the schema.
Once the XMLToSQL is instantiate, invoke the execute method to insert or update. XMLToSQL to connect to the database, and insert or update the data, then disconnect from the database (Figure
Connection pooling or datasource is not supported in this release. But XMLToSQL has a property to set a connection. By using this property, an application can set the connection. We will discuss how to do it later.