The fifth example shows, how to access databases with the DatabaseSender. It uses a table named example5 specially designed for this example. This table is already setup in the all-inclusive distribution. For the other distributions, you will find create statements in XBUS_HOME/src/sql to setup the example5 table. When there is no file for your database, you have to edit an existing one. Please be aware, that the first column (number) must be an automatically incrementing datatype.
First an XML file is read by the FileReceiver. This file contains three SQL statements:
- The first statement inserts a row in the database.
- The second and third statement select the whole content of the table, with different sorting.
The SQL statements will be sent to the database, the result is returned in a XML format and written into a file. The XML formats of the request and response are described here.
In a Windows command window type receiversingle Example5InFile, in a Unix shell type receiversingle.sh Example5InFile to start the processing of this example.