Docs‎ > ‎Integrate Menu‎ > ‎Data Sources‎ > ‎

Install JDBC Driver

The Live API Creator demonstration Jetty package includes JDBC drivers for MariaDB and MySQL, Apache Derby/JavaDB, and PostgreSQL. The database drivers are located in the CALiveAPICreator/lib/ext directory.

You can add other drivers, such as Oracle, SQL Server, MySQL, and DB2 to the CALiveAPICreator/lib/ext directory.

For more information about the list of databases that Live API Creator supports, see Supported Platforms.

We recommend that you add drivers to the container (for example, Jetty and Tomcat) rather than to the WAR file. But sometimes you may not be able to control the container, for instance in a cloud deployment. In that case, you may need to add the JDBC driver for your database to the WAR file itself.

The WAR file contains the required Oracle driver. You can deploy this file on a container such as Amazon Web Services (AWS) Elastic Beanstalk. For more information about installing on AWS Elastic Beanstalk, see Install on AWS Elastic Beanstalk.

The following image illustrates driver installation for SQL Server and Oracle. Your JAR names may differ based on versions:

Add a JDBC Driver to the WAR File

You can add a JDBC driver to the WAR file by issuing the following commands:
# for example, adding the Oracle drivers to a modified .WAR file
$mkdir WEB-INF WEB-INF/lib
$cp <path>/ojdb7.jar WEB-INF/lib/.
$zip -u CALiveAPICreator-2.1.00.1.war WEB-INF/lib/ojdbc7.jar

Install Microsoft SQL Server and Azure SQL Server Drivers

  1. Download the sqljdbc_4.2.6420.100_enu.tar.gz Microsoft SQL Server JDBC driver file from the Microsoft site. If necessary, scroll the screen to see the driver.
  2. Extract the file using the following command:
    tar -xf sqljdbc_4.2.6420.100_enu.tar.gz
  3. Locate the sqljdbc_4.2/enu/sqljdbc42.jar file and copy it into the extracted CA Live API Creator Jetty package into the CALiveApiCreator/lib/ext directory, relative to the directory with Start.sh in it. For more information about the location of this directory, see the image that illustrates the driver installation for SQL Server and Oracle in the previous section.
  4. Start the Jetty package.

Install Oracle JDBC Driver

  1. From the Oracle site, click the link for Oracle JDBC driver and download the ojdbc7.jar file and copy the JAR file into the extracted CA Live API Creator Jetty package into the CALiveApiCreator/lib/ext directory, relative to the directory with Start.sh in it.
    Note: Use the version of the Oracle driver that is compatible with the database version you are using.
  2. Start the Jetty package.

Install MySQL JDBC Driver

The MySQL JDBC driver works for various versions of MySQL, MariaDB, Amazon Aurora. For more information about the supported versions, see the MySQL site.
  1. Download, extract, and select the mysql-connector-java-5.1.37/mysql-connector-java-5.1.37-bin.jar file.
  2. Copy this file into the extracted CA Live API Creator Jetty package into the CALiveApiCreator/lib/ext directory, relative to the directory with Start.sh in it. The following image shows the directory:
  3. Start the Jetty package.

Install MariaDB JDBC Driver

MariaDB JDBC driver is compatible with MySQL. You can use the MariaDB JDBC driver or the MySQL JDBC driver. MariaDB JDBC driver's URL string has minor differences to MySQL JDBC driver's URL string.

For more information about MariaDB, see the MariaDB site.

The mariadb JAR is in the {CATALINA_HOME}/lib directory. Install the MariaDB JDBC driver to avoid optimistic locking failures. In your Tomcat directory, open the conf/server.xml file and insert the following XML code within the <GlobalNamingResources> tag:
<Resource accessToUnderlyingConnectionAllowed="true" 
        auth="Container" 
        defaultAutoCommit="false" 
        driverClassName="org.mariadb.jdbc.Driver" 
        initialSize="5" 
        logAbandoned="true" 
        maxActive="20" 
        maxIdle="10" 
        maxWait="30000" 
        minIdle="5" 
        name="jdbc/AdminDB" 
        password="localpassword" 
        removeAbandoned="true" 
        removeAbandonedTimeout="30" 
        type="javax.sql.DataSource"
        url="jdbc:mariadb://localhost:3306/dblocal_admin?characterEncoding=utf8
        username="dblocal_admin" 
        validationQuery="select 1"/>
        
Complete the following:
  • On systems that are not set to UTC, modify the MySQL connection string to work around timestamp issues.
  • Change the driverClassName entry's value to org.mariadb.jdbc.Driver.
  • If your MariaDB does not use UTF-8 by default, add the characterSet=utf8 parameter to the url parameter.