A pp licatio n

Q ue ry

S Q LTo X M Ld s

Pro pe rties

-Jd b cD r ive r -L og inID

-P as sw o rd

Data so urc e

-Jd b cS e rver -S c hem a

-A ction

-R e cu rse

 

S Q LToX M L

 

X M LTo S Q Ld s

 

X M LToS Q L

S Q L

 

P rop erties

 

-Jd bc D river

 

-Lo g in ID

D o cu m en t

 

-P as sw o rd

D ataso u rce

refo rm at

-Jd bc S er ve r

 

-S tatem en t

 

-Fo rm at

 

-R ec ur se

 

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

Page 294
Image 294
IBM Version 5 manual Class definition, Getting the datasource