DB Explorer

The DB Explorer allows users to query multiple types of databases in order to verify database contents. The following databases are supported: MySQL, SQL Server, DB2 and Oracle.

 

Access

  1. Go to functionizeapp.com/index.php/tools/dbexplorer

The DB Explorer Request form contains the following fields:

  1. Server IP

  2. Server Type (drop-down selection)

  3. DB Name

  4. Credentials (Username and Password)

  5. Query

Fill in all fields, then select Launch Request.

mceclip0.png

 

If connecting to DB2 or SQL Server, an additional field will show up called Functionize DB Service. See Advanced Database Integration below for usage.

 

Query Result

The Response Data will load. Select the + icon to open the details.

 mceclip1.png

The Response Data will include data that is returned from the database request. In this example, we can see the following data has been returned and we could proceed to perform validations on it within the test case.

  1. order_id

  2. firstname

  3. lastname

  4. date_added

  5. total

 mceclip2.png

Verify or store resulting data as you would with any other site.

 

Advanced Database Integration

If integrating with a JDBC interfacing database such as DB2, you will need to host a basic service to facilitate the communication between the Functionize Runtime environment and your database. This service will need to be set up in an environment where it can communicate directly with the database.

 

When using this configuration, the service that you install exposes a single endpoint to act as a passthrough to the database.

DB_Integration.png

Prerequisites

A minimum of Java 1.8 must be installed

Java needs to be added in system PATH

 

Installation

  1. Download the .jar here
  2. Test connectivity from the server where you would like to host the service
    1. The service can be run temporarily with `java -jar database_connectivity.jar` from the command line
    2. You can use a curl command to test DB2, MSSql, Oracle 
Drivers Available:

For msSQL - "com.microsoft.sqlserver.jdbc.SQLServerDriver"
For Oracle - "oracle.jdbc.driver.OracleDriver"
For db2 (JDBC4 specification) - "com.ibm.db2.jcc.DB2Driver"

curl -H "Content-Type: application/json" -X POST -d '{"sql":"DB_QUERY", "name":"DB_USER_NAME", "password":"DB_USER_PASSWORD", "dbname":"DB_NAME","server":"DB_SERVER_ADDRESS", "dbport": "DB_SERVER_PORT" , "driver":"DB_DRIVER"}' http://ADDRESS_OF_SERVICE:2511/query

    3. Once connectivity is verified, install as a service. Instructions to install as a Linux service is available upon request.

 

Usage

In the DB Explorer, you will see a field when using a JDBC interface called Functionize DB Service

mceclip0.png

Enter the IP and port for the service that was just hosted in this field. Every other input remains the same as any other database query.