Class Data
Method RunSPReturnXML(stored_procedure, params)
Send stored_procedure to database with params.
If database doesn't support XML output, take recordset and
convert it to XML.
Return XML.
End Method
Method RunSQLReturnXML(sql, params)
Send sql to database with params.
If database doesn't support XML output, take recordset and
convert it to XML.
Return XML.
End Method
Class_Initialize
Instantiate needed objects such as database connection tools.
Connect to database.
End Class_Initialize
Class_Terminate
Disconnect from database.
Clean up instantiated objects and end.
End Class_Terminate
End Class
####
SQL = new Data
DB2 = new Data
DOMSQL = new DOMDocument
DOMDB2 = new DOMDocument
employee_id = 999999
DOMSQL.loadXML(SQL.RunSPReturnXML("get_fav_colour", (employee_id)))
DOMDB2.loadXML(DB2.RunSQLReturnXML("SELECT LOCATIONS.ADDRESS1,
LOCATIONS.ADDRESS2, LOCATIONS.CITY, LOCATIONS.STATE, LOCATIONS.ZIP FROM
EMPLOYEES INNER JOIN LOCATIONS ON EMPLOYEES.LOCATION_ID = LOCATIONS.LOCATION_ID
WHERE EMPLOYEES.EMP_ID = ?", (employee_id)))
####
John Q. Public
999999
blue
####
. . .
. . .
. . .
. . .
. . .
####
DOMSQL.appendChild(DOMDB2.selectSingleNode("//LOCATION"))
####