dd db tutorial

17
Tutorial for Avaya Dialog Designer - Designing an Avaya Dialog Designer Database connector for Microsoft SQL server database AN; Reviewed ; SPOC 1/28/2008 Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved. 1 of 17 DD_DB_Tutorial

Upload: sureshkumar-singampallik

Post on 30-Oct-2014

17 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: DD DB Tutorial

Tutorial for Avaya Dialog Designer - Designing an Avaya Dialog Designer Database connector for Microsoft SQL server database

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

1 of 17 DD_DB_Tutorial

Page 2: DD DB Tutorial

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

2 of 17 DD_DB_Tutorial

Contents

About this Tutorial .........................................................................................................................................3

Intended Audience.................................................................................................................................3

Prerequisites ..........................................................................................................................................3

Chapter 1: Connecting to Microsoft SQL Server Database ......................................................................4

1.1 Connecting to the Database using Avaya Dialog Designer.........................................................4

1.2 Adding the Data Source to the Avaya Dialog Designer Project ..................................................6

Chapter 2: Creating the Database Operation File.....................................................................................9

2.1 Creating the Database Operation File in Eclipse.........................................................................9

2.2 Using the Database Operation File in the Dialog Designer Project...........................................15

References..................................................................................................................................................16

Page 3: DD DB Tutorial

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

3 of 17 DD_DB_Tutorial

About this Tutorial The Avaya Dialog Designer is a Java-based tool for creating VoiceXML speech applications. Designed as an Eclipse plug-in, the Avaya Dialog Designer provides an integrated graphical user interface (GUI) for designing self-service application. This tutorial explains how to use the Avaya Dialog Designer Wizards to connect to Microsoft SQL Server database. This tutorial contains the following chapters:

• Chapter 1:Connecting to Microsoft SQL Server Database • This chapter provides the details of the Avaya Dialog Designer configuration that is required to

connect to Microsoft SQL Server database. • Chapter 2:Creating the Database Operation File

This chapter explains the creation of a database operation file which is required to perform any required database operation.

After completion of this tutorial, the developer will be able to connect to Microsoft SQL Server database using Avaya Dialog Designer Wizards. Also, Dialog Designer applications can be created to fetch/insert data from/to the Microsoft SQL Server database.

Intended Audience This Tutorial is intended for Java programmers who have a working knowledge of Telecommunications applications and relational databases.

Prerequisites This tutorial assumes that the developer already knows how to create a simple speech application using the Avaya Dialog Designer. The following softwares need to be installed before trying out this tutorial:

• A database and its associated Java Database Connectivity (JDBC) drivers. This tutorial assumes that Microsoft SQL Server 2005 is installed.

• Avaya Dialog Designer 4.1.7.

Page 4: DD DB Tutorial

Chapter 1: Connecting to Microsoft SQL Server Database The Avaya Dialog Designer uses the Java Database Connectivity (JDBC) interface to connect to the database resources. Note: This tutorial uses the following SQL Server database schema. Database name: BookPrice Table name inside the ‘BookPrice’ database: BookTable Columns in the ‘BookTable’ table: ProductId, BookName and BookPrice.

1.1 Connecting to the Database using Avaya Dialog Designer

1. Start the Eclipse IDE.

2. Select Windows > Preferences. The Preferences screen is displayed.

Figure 1: The Preferences screen

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

4 of 17 DD_DB_Tutorial

Page 5: DD DB Tutorial

3. Expand the Dialog Designer menu and select Database.

Figure 2: Preferences > Database

4. Click Add.

5. In the Open dialog box, navigate to the <TomcatHome>\common\lib folder and select the

sqljdbc.jar file.

6. Click Open and then click Apply and OK. This adds the database drivers to the Avaya Dialog Designer environment.

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

5 of 17 DD_DB_Tutorial

Page 6: DD DB Tutorial

1.2 Adding the Data Source to the Avaya Dialog Designer Project

1. In the Eclipse Package Explorer navigator view, right-click the project and click Properties. In this tutorial, BookPrice is the name of the project. Right-click BookPrice > Properties. The Properties for the BookPrice project are displayed.

Figure 3: Properties

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

6 of 17 DD_DB_Tutorial

Page 7: DD DB Tutorial

2. Select Dialog Designer and select the Data Sources tab.

Figure 4: Dialog Designer screen > Data Sources > Database

3. Select the Database tab and click Add. The Create a new data source screen is displayed.

Figure 5: Create a new data source screen

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

7 of 17 DD_DB_Tutorial

Page 8: DD DB Tutorial

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

8 of 17 DD_DB_Tutorial

4. Enter the information for the following fields: • Name: Enter any name for the SQL Server database connection. • Driver Class Name: Select the SQL Server class name for the database driver. • Connection URL: Select the JDBC URL. • Username and Password: Database credentials as per configuration.

Note: a) The drop down list boxes are populated with past Driver Class Names and Connection

URL’s typed by the user and are not automatically populated by Dialog Designer. b) The Dialog Designer connector parses the connection URI string containing the database

name ‘BookPrice’ and connects to the database called ‘BookPrice’. 5. Click OK. This adds the data source to the Dialog Designer project.

Page 9: DD DB Tutorial

Chapter 2: Creating the Database Operation File This section explains how to create a database operation file to perform the required operation on the database.

2.1 Creating the Database Operation File in Eclipse 1. In the Eclipse Package Explorer navigator view, select the project name and then select

connectivity.

2. Right-click dboperations and select New > Other.

Figure 6: (dboperations) > New > Other selection

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

9 of 17 DD_DB_Tutorial

Page 10: DD DB Tutorial

3. The Select a wizard screen is displayed.

Figure 7: Select a wizard screen

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

10 of 17 DD_DB_Tutorial

Page 11: DD DB Tutorial

4. Select Database Operation File and click Next. The Create a Database Operation screen is displayed.

Figure 8: Database Operation selection screen

The available database operations are:

• Add • Delete • Execute • Query • Update

The next section of this tutorial will explain in detail how to query a desired database table (BookTable), obtain the result set and map it to Dialog Designer variables to access the result set.

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

11 of 17 DD_DB_Tutorial

Page 12: DD DB Tutorial

5. Select the project and enter values for the following fields: • Data Source name: Select the name of the data source from the drop down box. • Operation: Select an operation from the operation drop down box. (Example: Query) • File name: Enter a name for the database operation file. (Example: QueryBook).

Figure 9 : Create a Database Operation screen

6. Click Next. The Select Data Objects screen is displayed.

7. Select the data object that contains the required table.

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

12 of 17 DD_DB_Tutorial

Page 13: DD DB Tutorial

8. Select the required table.

Figure 10: Select Data Objects screen

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

13 of 17 DD_DB_Tutorial

Page 14: DD DB Tutorial

9. Click Next. The Map to Variables screen is displayed. User can select the AutoCreate check box or can use already created variables to map database column name with Dialog Designer variables as shown in Figure 11.

Figure 11: Map to Variables screen

In the Variable Name field, select the variable corresponding to the column and in the Variable Field, select the variable type.

10. Click Finish. This creates a database operation file.

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

14 of 17 DD_DB_Tutorial

Page 15: DD DB Tutorial

2.2 Using the Database Operation File in the Dialog Designer Project

1. To use the database operation file in the project, in the main.flow, drag and drop the relevant node and give it an appropriate name. For example: Query.

Figure 12: Naming the data node

2. Double-click the data node and drag and drop the database operation file from the Palette menu.

Figure 13: Adding the database operation file to the data node

3. Users can create a prompt file to announce result set (e.g., ProductId, BookName,

BookPrice) which was obtained from the database by using the Query Database operation. The above given steps can be followed to perform other available database operations using the database operation file.

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

15 of 17 DD_DB_Tutorial

Page 16: DD DB Tutorial

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

16 of 17 DD_DB_Tutorial

References The following documents are available at the Avaya DevConnect portal: (http://www.avaya.com/devconnect). • Avaya Dialog Designer Developer’s Guide Release 4.1. • Avaya Dialog Designer Getting Started with Dialog Designer Release 4.1.

Page 17: DD DB Tutorial

©2008 Avaya Inc. All Rights Reserved. Avaya and the Avaya Logo are trademarks of Avaya Inc. All trademarks identified by ® and ™ are registered trademarks or trademarks, respectively, of Avaya Inc. All other trademarks are the property of their respective owners. The information provided in this tutorial is subject to change without notice. The configurations, technical data, and recommendations provided in this tutorial is believed to be accurate and dependable, but is presented without express or implied warranty. Users are responsible for their application of any products specified in this tutorial. Please e-mail any questions or comments pertaining to this tutorial along with the full title name and filename, located in the lower right corner, directly to the Avaya DevConnect Program at [email protected].

AN; Reviewed ; SPOC 1/28/2008

Solution & Interoperability Test Lab Tutorial ©2008 Avaya Inc. All Rights Reserved.

17 of 17 DD_DB_Tutorial