Cisco Cisco Customer Voice Portal Downloads Developer's Guide
A
CTION
E
LEMENT
: D
ATABASE
C
ISCO
CVP V
OICE
XML 3.1
Element Specifications
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:
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.
returned, no element data will be set.
•
Multiple.
This is used to run a SQL query that returns multiple rows. A 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 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.
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)
(Type)
string
enum
Yes
true
true
single
The type of query:
single, multiple, insert
or
update
.
jndiName
(JNDI Name)
(JNDI Name)
string
Yes
true
true
None
This JNDI name for the SQL datasource of the database.
key
(Session Data 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.
which the results of the query will be stored.
query
(SQL Query)
(SQL Query)
string
Yes
true
true
None
The SQL query to be executed.
Copyright 2001 - 2005 Audium Corporation. All Rights Reserved. 10/05
24