Skip to main content Skip to complementary content

Managing the connection pool by using Tomcat

By default, a third-party application (c3p0) has been embedded into the configuration file of Talend Administration Center, to manage the connection pool.

The following procedure allows Tomcat to manage directly the connection pool. You can also apply this procedure to JBoss.

Procedure

  1. In the <ApplicationPath>/WEB-INF/classes folder, change the default setting of the configuration.properties file to:
    database.useContext=True
  2. In the WEB-INF folder, edit the web.xml file and add the following piece of code before the closing tag </web-app>:
    <resource-ref>
    
         <description>Our Datasource</description>
         <res-ref-name>jdbc/ADMINISTRATOR_CONNECTION</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
    
    </resource-ref>
  3. In the WEB-INF folder, edit the context.xml file and configure the parameters of connection to the database by modifying the following elements:
    Element name Value

    url

    • jdbc:mysql://{ip_address}:3306/{db_name}

      For MySQL, where ip_address corresponds to the database IP address and db_name corresponds to its name.

    • jdbc:oracle:thin:@{ip_address}:1521:{db_name}

      For Oracle, where ip_address corresponds to the database IP address and db_name corresponds to its name.

    • jdbc:jtds:sqlserver://{ip_address}:1433/{db_name}

      For SQL Server, where ip_address corresponds to the database IP address and db_name corresponds to its name.

    • jdbc:h2:file:{dir_path/}<db_name>;MVCC=TRUE;AUTO_SERVER=TRUE; LOCK_TIMEOUT=15000

      For H2, where dir_path corresponds to the database path and db_name corresponds to its name.

    username

    The username used to log in to your database, talend_admin by default.

    password

    The password used to log in to your database, talend_admin by default.

    driverClassName

    • org.gjt.mm.mysql.Driver for MySQL
    • oracle.jdbc.driver.OracleDriver for Oracle
    • net.sourceforge.jtds.jdbc.Driver for SQL Server
    • org.h2.Driver for H2
  4. Copy the relevant .jar file corresponding to the database in which your data is stored in <TomcatPath>/lib/.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!