Configure JNDI for Integration - Tomcat

For MySQL

How to Configure JNDI

  1. Copy the mysql-connector-java-8.0.12.jar from the QuantumFabric_Plugins\resources folder.
  2. Paste the mysql-connector-java-8.0.12.jar file under user install directory inside the Tomcat > Lib folder - for example, <User install directory>\apache-tomcat-9.0.33\lib.

How to Configure Data Source - Context.xml

  1. Open the context.xml file located under <User install directory>\apache-tomcat-9.0.33\conf depending on the database type.
  2. In the context.xml file, create two entries one for konyadmindb and the other for KDCDB by using the following template:
    
    <JarScanner scanManifest="false"/>
    <Resource name=<JNDI_NAME> auth="Container" type="javax.sql.DataSource" maxActive="10" maxIdle="5" maxWait="10000" scope="Shareable" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" username="<USER_NAME>" password="<PWD>" driverClassName="<DB_Driver>" defaultReadOnly="true" url="<AdminDB_Connection_String>" testWhileIdle="true" testOnBorrow="true" testOnReturn="false" validationQuery="SELECT 1" validationInterval="30000" timeBetweenEvictionRunsMillis="30000" initialSize="1" minIdle="0" removeAbandonedTimeout="300" removeAbandoned="true" logAbandoned="true" minEvictableIdleTimeMillis="30000" jmxEnabled="true"/>
  3. In the context.xml file, add the following data source configurations:

    In the following data source configurations, you must replace the following fields with appropriate values to access the database.

    The following table details field names to be configured for data source:

    Field NameValue
    <DB_Driver>

    Database specific driver,

    • MySQL: com.mysql.jdbc.Driver
    • ORACLE: oracle.jdbc.driver.OracleDriver
    • MSSQL: com.microsoft.sqlserver.jdbc.SQLServerDriver
    <JNDI_NAME>

    JNDI string.

    • jdbc/konyadmindb
    • jdbc/KDCDB
    <PWD>Database password
    <DB_connection_String>

    Database connection string,

    • MySQL: jdbc:mysql://localhost:3306/databaseName?autoReconnect=true&useSSL=false
    • ORACLE: jdbc:oracle:thin:@hostname:port Number:databaseName
    • MSSQL: jdbc:sqlserver://DBHOSTIP[\DBINSTANCENAME]:PORT;databasename=DBNAME
    <USER_NAME>Database username. For example, root
    • The following JNDI configuration template is for Quantum Integration Service component:
  4. Save the context.xml file.

How to Configure Data Source - Admin.xml

  1. Go to <User install directory>\apache-tomcat-9.0.33\conf\Catalina\localhost folder.
  2. Create the admin.xml file.
  3. In the admin.xml file, add the following data source configurations:

    In the following data source configurations, you must replace the following fields with appropriate values to access the database.

    The following table details field names to be configured for data source:

    Field NameValue
    <DB_Driver>

    Database specific driver,

    • MySQL: com.mysql.jdbc.Driver
    • ORACLE: oracle.jdbc.driver.OracleDriver
    • MSSQL: com.microsoft.sqlserver.jdbc.SQLServerDriver
    <JNDI_NAME>
    • jdbc/konyreports.
    <PWD>Database password
    <DB_connection_String>

    Database connection string,

    • MySQL: jdbc:mysql://hostname/databaseName
    • ORACLE: jdbc:oracle:thin:@hostname:port Number:databaseName
    • MSSQL: jdbc:sqlserver://DBHOSTIP[\DBINSTANCENAME]:PORT;databasename=DBNAME
    <USER_NAME>Database username. For example, root
    • The following JNDI configuration template is for Quantum Integration Service (reportsdb) component:
      <?xml version="1.0" encoding="utf-8" ?>
      <Context>
      <Resource auth="Container" driverClassName=="<DB_Driver>" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" initialSize="5" jmxEnabled="true" logAbandoned="true" maxActive="10" maxIdle="5" maxWait="10000" minEvictableIdleTimeMillis="30000" minIdle="2" name="jdbc/konyreports" password="<PWD>" removeAbandoned="true" removeAbandonedTimeout="600" testOnBorrow="true" testOnReturn="false" testWhileIdle="true" timeBetweenEvictionRunsMillis="30000" type="javax.sql.DataSource" url="<AdminDB_Connection_String>" username="<USER_NAME>" validationInterval="30000" validationQuery="SELECT 1"/>
      </Context>
  4. Save the admin.xml file.