# DB Connector

This connector allows to perform operations with external or internal (provisioned through ProcessMIX) relational databases (RDBMS): querying, inserting, updating, and deleting data stored in the database tables.

### Supported Database Types

* PostrgreSQL&#x20;
* Oracle 11g

***

### Connector Settings

* Name - refers to the unique identifier. (must consist of letters (A-Z or a-z), digits (0-9), underscores (\_), or dollar signs ($). However, a class name cannot start with a digit and dollar sign ($))
* Database type - defines type of database to connect
* [URL](#url) -  address of the database to connect.&#x20;
* User - username
* Password - password

All settings should be defined as [global variables](../global-variables). This enables the redefinition of values for new deployments.

{% hint style="info" %}
Global variables allow the definition of different values for development, test, pre-production, and production environments.
{% endhint %}

### URL

URL is a string that depends on type of database to connect with.

URL structure:&#x20;

<mark style="color:blue;">`jdbc`</mark>`:`<mark style="color:purple;">`db_type`</mark>`://`<mark style="color:orange;">`server`</mark>`:`<mark style="color:red;">`port`</mark>`/`<mark style="color:yellow;">`db_name`</mark>`?currentSchema=`<mark style="color:green;">`schema_name`</mark>

* <mark style="color:blue;">`jdbc`</mark> - system uses Java drivers to connect to databases. Don't modify this prefix
* <mark style="color:purple;">`db_type`</mark> - database type
* <mark style="color:orange;">`server`</mark> - database server address
* <mark style="color:red;">`port`</mark> - server port
* <mark style="color:yellow;">`db_name`</mark> - database name
* <mark style="color:green;">`schema_name`</mark> - (OPTIONAL) define schema to restrict access inside query builders

Example:

> jdbc:postgresql://dbpublic.cloud.domain.com:5455/ewallet?currentSchema=public

***

### Queries

There are two types of queries:

1. [Prepared](db-connector/prepared-query) - SQL should be defined during the design phase.
2. [Dynamic](db-connector/dynamic-query) - SQL should be defined at runtime.
3. [Stored procedure](db-connector/stored-procedure) - allows to call stored procedures

***

### Transactions

A transaction is a set of operations for working with a database (DB), combined into one atomic bundle. It is used when it is important to perform a set of actions altogether, if each separate action does not make any sense without the others, or if the data in different places must be in a consistent state.&#x20;

If at least one operation from the transaction fails as an error or exception, the system cancels and undoes ("rolls back") every database operation completed so far, restoring the data to its previous stable state.

Find more information please refer to the following help sections:

* [BeginTransaction](../flows/nodes/connectors/database-begin-transaction)&#x20;
* [CommitTransaction](../flows/nodes/connectors/database-commit-transaction)
* [RollbackTransaction](../flows/nodes/connectors/database-rollback-transaction)
* [DbConnector](../flows/nodes/connectors/database-query-executor)

