Cisco Cisco Unified Customer Voice Portal 11.0(1) Developer's Guide

Page of 103
A
CTION 
E
LEMENT
:
 
D
ATABASE
 
 
 
          
E
LEMENT 
S
PECIFICATIONS FOR 
C
ISCO 
U
NIFIED 
C
USTOMER 
V
OICE 
P
ORTAL 
R
ELEASE 
4.0(1)
 
 
 
13
 
Database 
The database element provides the ability to execute an SQL command on external databases within a voice application call flow. The 
element requires JNDI to be configured in the Java application server to handle database connections. Only a single SQL statement 
can be executed per element.  There are four types of commands that can be made: 
   
Single.
  This is used to run a SQL query that returns only a single row. Element data will be created with the variable names 
being the names of the columns returned and the value of that column as the element data value (as a string). If no row is 
returned, no element data will be set.  
   
Multiple.
 This is used to run a SQL query that returns multiple rows. A Unified CVP-defined Java data structure, the Java class 
ResultSetList
, stores the full result and is placed in session data. If no rows are returned, the 
ResultSetList
 object in 
session data will be empty. For detail about the 
ResultSetList
 data structure, refer to the Javadocs for Cisco Unified 
Customer Voice Portal for this class.  
   
Inserts.
 This is used to run a SQL INSERT command that inserts information into the database.  
   
Updates.
 This is used to run a SQL UPDATE command that updates information in the database. 
The developer can utilize substitution to create dynamic queries. The Database element is ideal for performing simple queries and 
updates. It may not be sufficient for performing complex database interactions such as multiple dependent queries or stored procedure 
calls. One would use a custom configurable or generic action element for these tasks. Also note that in order to avoid performance 
issues creating database connections, implementing database pooling on the application server is highly recommended. 
Settings 
Name (Label) 
Type 
Req’d 
Single 
setting 
value 
Substitution 
allowed 
Default 
Notes 
type 
(Type) 
string 
enum 
Yes 
true true single 
The type of query: single, multiple, insert or 
update
jndiName 
(JNDI Name) 
string Yes  true true  None 
This JNDI name for the SQL datasource of the database. 
key 
(Session Data Key) 
string Yes  true 
true
 
None 
For queries of type multiple, the name of the session variable 
which the results of the query will be stored. 
query 
(SQL Query) 
string Yes  true 
true
 
None 
The SQL query to be executed.