Table of contents
- Drivers Tomcat Test
- Tomcat Drivers Jdbc
- Driver Tomatoes
- Drivers Tomcat Installer
- Driving To Catalina Island
Apache Tomcat is a servlet engine that runs Java web applications, which are packaged as web application archive files, or WARs. A WAR file is the one that’s deployed to Tomcat, not a JAR file. But, despite the fact that the question of how to deploy a JAR isn’t one that’s commonly asked, it’s worth further exploration. See Tomcat documentation for details. Install your JDBC Drivers. Add the jar files for your JDBC drivers to the Viewer. Copy the driver the following directory: BIRT JDBC Driver Location Note: If you are installing BIRT 2 series the driver needs to be copied to birt-viewer WEB-INF platform plugins org.eclipse.birt.report.data.oda.jdbc drivers directory. In this article we add MariaDB (MySQL) to our Tomcat Ubuntu 18.04 LTS server in AWS EC2. I cover the basics of how to integrate it with your Tomcat web applications. If you’ve been playing along at home, you know this is part 4 of a series that started here. Installation Installing MariaDB in Ubuntu Continue reading 'Tomcat in AWS – Part 4 – Install MariaDB / MySQL'.
Tomcat Installer free download - CopyTrans Drivers Installer, Pak Urdu Installer, Apache Tomcat (64 bit), and many more programs. If every application hosted on your Tomcat server uses a MySQL database, it would make sense to place the MySQL database drivers in Tomcat’s lib directory, and not in the WEB-INF lib directory of the WAR. Furthermore, if you have an upgraded database but the JDBC drivers need to be upgraded, by updating the JAR file in that one shared location, it will mean all of the applications will start using the same set of updated Java libraries at the same time.
Configuring a JNDI datasource allows you to create the bridge between a JNDI resource in your Tomcat Application server and the Elements Connect add-on.
JNDI datasources use JDBC drivers that get a connection to a datasource. Once a JNDI datasource is configured, you'll be able to:
- Browse the datasource from the field configuration tester
- Query the datasource using SQL to feed your Elements Connect fields.
The advantages of using a JNDI datasource over a Database connection are multiple:
- JNDI datasources use underlying Tomcat connection pool thus optimising expensive connection resources creation and a providing faster access to Elements Connect fields data
- The direct database connection only supports 4 databases: Oracle, SQL Server, PostgresQL and MySQL. If you datasource is not in this list, there shall be a JDBC driver for it.
The configuration of a JNDI datasource is done in two steps:
- declare a JNDI datasource in Tomcat
- configure the JNDI datasource in Elements Connect
Drivers Tomcat Test
Download and install the JDBC driver
There are JDBC drivers for many datasources. The following drivers have been tested and are compatible with Elements Connect.
If your datasource is not listed, chances are that a JDBC driver exists: JBDC is a well-established and common standard.
Datasource | Driver |
---|---|
PostgreSQL | PostgreSQL JDBC driver (official) |
MySQL | Connector/J (official) |
SQLServer | Microsoft JDBC Driver for SQL Server (official) jTDS JDBC Driver (alternative) |
Oracle | Oracle database JDBC driver (official) |
CSV files | csvjdbc (open source) |
IBM DB2 | IBM DB2 JDBC Driver (official) |
Add the JDBC driver to Tomcat
The first step is to add the JDBC driver in the Tomcat lib
folder.
This folder is located in the Atlassian installation directory.
On Linux, the default installation directory is /opt/atlassian/jira
the lib folder is /opt/atlassian/jira/application/lib
Read the official Atlassian documentation about Jira application directory.
Example with the jdbc-driver-csv
Declare the JNDI datasource in Tomcat server.xml
Locate the server.xml
Tomcat configuration file.
In a standard Linux installation, this file is located under /opt/atlassian/jira/application/conf
In the server.xml
file, locate the Context
section (under Engine
> Host
):
You may have existing <Resource>
entries under the <Context>
section, like:
Add a new section to declare you JNDI connection - here is an example using the PostgreSQL JDBC driver:
The final file is
Each JDBC driver has its own specificities, read the JDBC driver documentation to learn more.
The important parts are:
- name - the JNDI resource name that you will use in the Elements Connect datasource configuration - it must be unique
- driverClassName - unique for every JDBC driver
- url - the JDBC connection URL, usual well documentation
To learn more, read the official Tomcat documentation.
Restart Jira
To be able to use the new JNDI connector in Elements Connect, Jira must be restarted.
Once you have declared a JNDI resource in Tomcat (and restarted Jira), you can declare a new datasource in Elements Connect.
From the datasource configuration section, click on 'Create a datasource' then select 'JNDI reference'.
Name
It will be used later to reference the datasource connector to use in the configuration of Elements Connect fields
Description
A reminder of why you are using this connector
JNDI name
Name of the resource declared in the server.xml
file (see above)
Prepend the name declared in Tomcat with java:comp/env/
If the JNDI resource name is jdbc/crm-database
, in Elements Connect the JNDI name will be java:comp/env/jdbc/crm-database.
The last step is to Save the configuration!
Once you have declared a new JNDI datasource, you can use it in a field configuration and query with SQL.
See Configure a field query.
This section shows how to declare some drivers in the server.xml
file
Sql Server
Driver
Configuration
Datasource declaration in the Tomcat server.xml
file:
JNDI Database configuration in Elements Connect:
Name | My SQL Server Database command |
---|---|
Description | List of command |
JNDI Name | java:comp/env/jdbc/ext |
PostgreSQL
Driver
Configuration
Datasource declaration in the Tomcat server.xml
file:
JNDI Database configuration in Elements Connect:
Name | My Client PostgreSQL Database |
---|---|
Description | List of client |
JNDI Name | java:comp/env/jdbc/CRMDS |
Tomcat Drivers Jdbc
csvjdbc
Driver Tomatoes
Driver
Project is hosted on GitHub.
Jar files can be downloaded from https://sourceforge.net/projects/csvjdbc/files/CsvJdbc/
Drivers Tomcat Installer
Configuration
Driving To Catalina Island
Datasource declaration in the Tomcat server.xml
file:
JNDI Database configuration in Elements Connect:
Name | Sales CSV |
---|---|
Description | List of sales |
JNDI Name | java:comp/env/jdbc/sales-csv |