net.sf.xbus.technical.database
Class DatabaseSender

java.lang.Object
  extended by net.sf.xbus.technical.database.DatabaseSender
All Implemented Interfaces:
ObjectSender, Sender

public class DatabaseSender
extends java.lang.Object
implements Sender, ObjectSender

The DatabaseSender sends SQL-statements to a database and returns the results. The request and the response are XML documents.

Please refer to the documentation about the structure of the XML documents.


Constructor Summary
DatabaseSender(XBUSSystem destination)
          The constructor stores the destination.
 
Method Summary
 java.lang.Object execute(java.lang.String function, java.lang.Object callData)
          Sends SQL statements to the database and return the results.
 java.lang.String getType()
          A Sender can send data either as a String or as an Object to the neighboring system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseSender

public DatabaseSender(XBUSSystem destination)
The constructor stores the destination.

Parameters:
destination - definition of the interface in standard.conf
Throws:
XException - never thrown
Method Detail

execute

public java.lang.Object execute(java.lang.String function,
                                java.lang.Object callData)
                         throws XException
Sends SQL statements to the database and return the results.

Specified by:
execute in interface ObjectSender
Parameters:
function - not used
callData - XML document containing SQL statements
Returns:
XML document with result when callData contained SELECT statements, NULL otherwise
Throws:
XException - in case of errors

getType

public java.lang.String getType()
Description copied from interface: Sender
A Sender can send data either as a String or as an Object to the neighboring system.
When working with Strings the Sender must fulfill two preconditions: When working with Objects the Sender must also fulfill two preconditions:

Specified by:
getType in interface Sender