Use the DynamicSQL component to run any SQL statement on any database that is configured as an external resource in your project. The SQL statements are sent directly to the database server via the JDBC driver; the Process Execution Engine does not check or modify the statements in any way.
You can do the following by using the DynamicSQL component:
To access the BAM (Business Activity Monitoring) database, use the BAMQuery component.
DynamicSQL is built on top of Java's java.sql.PreparedStatement.
externalResource = "coffee_db"
sql = "SELECT COF_NAME, PRICE FROM COFFEES"
for each row in executeQuery(DynamicSQL, sentence : sql,
implname : externalResource ) do
coffeeName = row[0]
coffeePrice = row[1]
display "Coffee "+coffeeName + "is $"+ coffeePrice
end
externalResource = "coffee_db"
sql = "UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ? "
sales = 75
coffeeName = "Colombian"
rowsModified = executeUpdate(DynamicSQL, sentence : sql,
implname : externalResource,
inParameters : params)