
A pp licatio n
Q ue ry | S Q LTo X M Ld s |
Pro pe rties
Data so urc e |
| S Q LToX M L |
| X M LTo S Q Ld s |
| X M LToS Q L |
S Q L |
|
P rop erties |
|
| |
D o cu m en t | |
| |
D ataso u rce | |
refo rm at | |
| |
| |
| |
|
J 2E E
J N D I
C o n ne ction
P oo lin g
DB
Figure 11-10 SQLToXMLds and XMLToSQLds
Tip: You need to add naming.jar from runtime library under runtime/base_v5/lib.
Class definition
Both SQLToXMLds and XMLToSQLds extend SQLToXML and XMLToXML. Each class has a global variable to keep the datasource. The following code fragment shows the class definition:
public class XMLToSQLds extends XMLToSQL{
private DataSource datasource;
}
public class SQLToXMLplus extends SQLToXML{
private DataSource datasource;
}
Getting the datasource
We add to methods to set datasource. We used two approaches to get the datasource.
278 The XML Files: Development of XML/XSL Applications Using WebSphere Studio