Complete the following steps to use a Database Service with a Compute node:
Procedure
In the Application Development view, select the required Database Service.service file.
Drag the selected Database Service onto
a Compute node. Alternatively,
right-click the Compute node,
click Use Database Service, and select the
required Database Service.
Select the required database operations. This
results in the following actions:
A compute module named DatabaseServiceName.esql is
generated in the broker schema that is derived from the namespace
of the service and port type of the database binding. This compute
module contains one ESQL procedure for each database operation that
you selected, and is located in the same library as your Database Service file.
Note: The port type name
is the same as the operations group name that you created on the Service
Operations panel of the Database Service editor.
A PATH statement for the generated compute module is created so
that the Database Service can be called.
This PATH statement is located in the ESQL module that is associated
with your Compute node.
In your ESQL module, call the Database Service by supplying the required parameters.
Optional: Add ESQL code to handle database
errors that might occur when you call the generated procedure. For
more information, see Coding ESQL to handle errors.
Note: Database
errors are raised as exceptions only if the Throw exception on database error check
box is selected on the Compute node.
The check box is selected by default. For more information, see Compute node.
Results
The Compute node
can access the database operations that you specified in your Database Service.