Database

This feature allows you to configure DB (Database) APIs. The DB APIs are the database store procedures or functions. These store procedure and functions contain a SQL statement that connects with the database and returns the result.

To create a DB API, you access a database client such as Oracle, MYSQL, or Postgres SQL. In the database client, you build a store procedure or function to create a DB API. Thus, you need to configure the DB API on the vConnect platform.

To configure the DB API:

  1. On the home page of the vConnect module, find the API Management tab.
  1. Click the API Management tab to open the API Management page.
  2. On the API Management page, click Add New API, and the application displays the types of APIs that you can configure.
  1. In the API Type area, click Database, and the application displays the following boxes:
List/BoxDescription
API NameIn this box, enter the name of the API (for example:-Authenticate).
Query TimeoutIn this box, enter the numeric value (For example:- 120) in “seconds” (unit of time). This value specifies the maximum amount of time until the query attempts to connect to the database. If the query’s attempt to connect to the database exceeds the query timeout, the API will display error.
DescriptionIn this box, enter a brief description of the API.
DB Definition IdFor the database API, this property allows you to configure the database that the DB (database) API connects to fetch the response.

To configure the database:
–> Right to the DB Definition Id box, click the plus icon (), and the Add New Database dialog box opens.
–> On the Add New Database dialog box, enter the values in the respective boxes as follows:
1. Database Connection Name: – In this box, enter the name of the database connection.
2. Type of Database: – Click this list to select the database (for example: – Oracle).
3. Load Balancer: – Click this list and then select Y to use the load balancer for database configuration. Otherwise, select N. (Optional step)
4. IP Address: – Click this list to select the IP address of the database.
5. Port Number: – Click this list to select port number to connect to the database.
6. Database Name: – Click this list to select the name of the database client.  

Note: – You define a name of the database when you configure a database client on your computer system. Refer the earlier screen capture of Postgres SQL Connection screen.

7. Schema Name: – Click this list to select the name of the schema. (Optional step)
8. User Name: – Click this list to select the user name so that the API can access the database.

Note: – You also define a user name and a password to create a user account at the database level when you configure a database client on your computer system.  

9. Password: – Click this list to select the password so that the API can access the database.
10. Connection Pool: – Click this list and then select Y to establish a connection pool that maintains the cache of the database connection. (Optional step)
11. Max Active Conn: – Click this list to select the value that specifies the maximum number of active connections that the API can establish with the database. (Optional step)
12. Max Ideal Conn: – Click this list and then select the value that specifies the maximum number of connections or queries that can connect to the database concurrently. (Optional step)
13. Max Wait Timeout: – Click this list and then select the maximum time that the query will be active to connect with database and get the result. If the query’s active session time exceeds the maximum wait timeout, the query will throw an error.
Execution TypeClick this list and then select one of the following options:
–> PROCEDURE: – Select this option if you want to use the store procedure to connect to the database. After you select this option, the Procedure Name list appears.

–> FUNCTION: – Select this option if you want to use the function to connect to the database. After you select this option, the Function Name list appears.
Procedure NameClick this list to select the procedure. In the selected procedure, the query executes to connect to the database and get the result.
Function NameClick this list to select the function. In the selected function, the query executes to connect to the database and get the result.
Logs RequiredClick this check box to maintain the logs of API.
Connection PoolClick this check box to maintain the database connection in the cache.
  1. After you select the procedure or function, the Parameters Definition area appears.
  2. The Parameters Definition area displays the list of non-editable parameters that are defined in the code of API.
  3. In the Parameters Definition area, configure the parameters as follows:
List/BoxDescription
End Point Param NameThis field displays the name of parameter that is defined in the code of API.  
Source of ValueClick this list and then select a specific source (For example: – REQUEST_BODY or HEADER) from where the parameter will fetch the value.
ValueIn this field, enter a parameter. You map this parameter to a value or absolute JSON path of an element (for example: – text box) when you configure the API on an element (for example: – button) in the vDesigner module. Let’s explore how to define a parameter when you select HEADER or REQUEST_BODY in the Source of Value list. 

Case1:- (If you select HEADER in the Source of Value list)
–> The End Point Param Name box displays the name of parameter (For example: – org_id) that is defined in the code of API.
–> In the Source of Value list, select HEDAER.
–> In the Value box, enter x_org_id.
–> Scroll down and then click Save to configure the parameter.




Case2:- (If you select REQUEST_BODY in the Source of Value list)
–> The End Point Param Name box displays the name of parameter (For example: – login_id) that is defined in the code of API.
–> In the Source of Value list, select REQUEST_BODY, and the Value box displays the dollar character ($) that is followed by the dot (.) character.
–> After the dot (.) character, enter a parameter (for example:- x_login_id).
–> Scroll down and then click Save to configure the parameter.


Was this article helpful?
YesNo