The dblookup mediator is capable of executing an arbitrary SQL select
statement, and then set some resulting values as local message properties on
the message context. The DB connection used maybe looked up from an external
DataSource or specified in-line, in which case an Apache DBCP connection pool
is established and used.
In-lined Data Source
driver - Database driver class name
url - Database URL
user - User name for access Database
password Password for access Database
This new Datasource is based on Apache DBCP connection pools. This
connection pool support the following configuration properties:
dsName - The name of the Datasource to be looked up
icClass - Initial context factory class. The
corresponding java environment property is
java.naming.factory.initial
url - The naming service provider url . The
corresponding java environment property is
java.naming.provider.url
user - This is corresponding to the java environment
property java.naming.security.principal
password - This is corresponding to the java environment
property This is corresponding to the java environment property
java.naming.security.principal
SQL Statements
sql - One or more SQL Statements
parameter - Specify how the values of parameter in the
SQL would be calculated. A value can be static literal text and can be
calculated at runtime based on the given expression.
result - Specify how to deal with rerun result from
Database query execution.
More than one statement may be specified, and the SQL statement may specify
parameters which could be specified as values or XPath expressions. The types
of parameters could be any valid SQL types. Only the first row of a result set
will be considered and any others are ignored. The single
<result> element contains the 'name'
and the 'column' attributes. The 'name'
attribute defines the name under which the result is stored in the Synapse
message context, and the column attribute specifies a column number or name .