# Integrating Oracle Autonomous Database with Maathra ReportFactory - Backend

# Introduction

This article explains the steps to configure Oracle Autonomous Database as the backend for Maathra ReportFactory. Please note that these instructions are not applicable if you are using APEX as a service. If you're using a standalone database, refer to this article for configuration: [https://blog.maathra.com/guide-to-installing-and-configuring-maathra-reportfactory](https://blog.maathra.com/guide-to-installing-and-configuring-maathra-reportfactory)

This is an additional step to connect to the Autonomous Database as a backend. You must complete the other steps mentioned in this article.

# Connecting to Autonomous DB

Connecting to Oracle Autonomous Database involves two steps: downloading the cloud wallet and configuring the JNDI source in Apache Tomcat.

## Downloading Database Wallet

Oracle Wallet is a secure container used to store authentication and signing credentials, including private keys, certificates, and trusted certificates, necessary for secure connections to your database.

1. Log in to your Oracle Cloud account.
    
2. Find the Oracle Autonomous Database service you want to connect with ReportFactory.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716370445022/c358f9ce-e8cc-455c-a872-dcc5cc427008.png align="center")
    
3. Click Database Connection
    
4. Select Wallet Type: Instance wallet
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716370471405/71f8222d-5fdc-4c9e-8255-b1297edc0605.png align="center")
    
5. Create a wallet password and click download
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716370502630/ee82ac08-0e5c-4474-bed4-a06511a81181.png align="center")
    
6. Note down the connection string
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716370549650/4465c2de-3f41-4531-894c-bfaf43b8b8e5.png align="center")

## Configuring Apache Tomcat

* Unzip the downloaded wallet and move it to a secure location on the server.
    
* If you plan to use the same database as a data source, it is recommended to place the unzipped files inside the ReportFactory root folder --&gt; wallets.
    
    ### Configuring Application Datasource in Apache Tomcat
    
    Open `context.xml` for editing from the Apache Tomcat Root folder --&gt; conf --&gt; `context.xml`.
    

```xml
<Resource name="jdbc/OracleDB"
          auth="Container"
          type="javax.sql.DataSource"
          driverClassName="oracle.jdbc.OracleDriver"
          url="jdbc:oracle:thin:@TNS_NAME?TNS_ADMIN=/path/to/wallet"
          username="DB_USER"
          password="DB_PASSWORD"
          maxTotal="20"
          maxIdle="10"
          maxWaitMillis="-1"/>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716376648749/ff757b35-fede-4959-8290-ff940caf2251.png align="center")

### Add additional jar files to the lib folder to connect to the Autonomous Database

* [https://mvnrepository.com/artifact/com.oracle.database.security/oraclepki/19.3.0.0](https://mvnrepository.com/artifact/com.oracle.database.security/oraclepki/19.3.0.0)
    
* [https://mvnrepository.com/artifact/com.oracle.database.security/osdt\_cert/19.3.0.0](https://mvnrepository.com/artifact/com.oracle.database.security/osdt_cert/19.3.0.0)
    
* [https://mvnrepository.com/artifact/com.oracle.database.security/osdt\_core/19.3.0.0](https://mvnrepository.com/artifact/com.oracle.database.security/osdt_core/19.3.0.0)
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716376117880/dd88ab2d-9d6e-45d5-9553-634f31bab473.png align="center")
    

Once you complete the above setup restart the Tomcat server.

## **Verifying the Installation**

* Open a web browser and enter the ReportFactory status URL.
    
    ```xml
      http://host:port/apex-report-factory/scheduler/checkstatus
    ```
    
* If the server responds with code 200, the installation is successful.
    
    ```xml
          {"code":"200","message":"All Maathra ReportFactory services are up and running."}
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716346838848/cdccf202-c1df-48b3-9af9-7245d3356cde.png?auto=compress,format&format=webp align="left")
    
    Return to the article "abcd" and continue configuring or testing ReportFactory from the section "Configuring Maathra ReportFactory using the APEX application."
    

Thank you for following this guide. We hope it has provided you with the necessary steps and insights to effectively configure and utilize ReportFactory with the Oracle Autonomous Database. Should you have any further questions or require additional support, please don't hesitate to consult the referenced materials or reach out to our support team at arf.support@maathra.com. Good luck with your continued use of ReportFactory, and we look forward to assisting you in maximizing your reporting capabilities.
