How to configure JNDI for CVP VXML server for database integration

see http://docwiki.cisco.com/wiki/Unified_CVP_VXML_Server_JNDI_Resources

Overview Steps to configure JNDI on CVP VXML server (running Tomcat)

* Enable database access on your CVP VXML server by installing a compatible JDBC driver * Add the JNDI Context config for the database connection to the context.xml file - for detailed guide view Tomcat 5.5 JNDI Datasource HOW-TO * Restart the Tomcat service Cisco CVP VXMLServer * In your CVP Studio application configure a database Action Element with your newly configured JNDI name (do not include the jdbc/ portion), the SQL Type (Insert, Update, Single, Mutiple) and the SQL Query.

Step by Step guide on how to configure JNDI for a SQL Server 2005

SQL Authentication context.xml example

  
<Resource name="jdbc/cvpdb"
   auth="Container"
   type="javax.sql.DataSource"
   driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
   url="jdbc:sqlserver://123.123.123.123:1433;databaseName=cvp_db;user=myusername;password=Pa$$w0rd"
   />

Note: JNDI name = jdbc/cvpdb in above example. Confirm that your SQL server is setup for mixed mode authentication to allow SQL authentication, i.e. SQL Server and Windows Authentication mode. Make sure that the user configured has required read and / or write access reqiured for the CVP Studio Application

Windows Authentication example

<Resource name="jdbc/cvpdb"
   auth="Container"
   type="javax.sql.DataSource"
   driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
   url="jdbc:sqlserver://123.123.123.123:1433;databaseName=cvp_db;integratedSecurity=true"
   />

Note: Windows Authentication requires the Tomcat VXML service Cisco CVP VXMLServer is configured to logon as a user with local administrive rights on the server. Confirm that this to configured with the required read and / or write access to the database

This example adds extra configuration to remove issues with connections becoming stale

   <Resource name="jdbc/cvp_database"
   maxWait="10000"
   maxActive="16"
   maxIdle="8"
   minIdle="4"
   auth="Container"
   type="javax.sql.DataSource"
   driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
   removeAbandoned="true"
   removeAbandonedTimeout="300"
   testOnBorrow="true"
   validationQuery="SELECT 1"
   timeBetweenEvictionRunsMillis="300000"
   minEvictableIdleTimeMillis="1800000"
   url="jdbc:sqlserver://192.168.1.123:1433;databaseName=cvp_database;user=bob;password=Pa$$w0rd"
   />

http://www.codingpedia.org/ama/tomcat-jdbc-connection-pool-configuration-for-production-and-development/