# Database Adapter

## <mark style="color:blue;">Architecture</mark>

### Data Base Step Processor

<figure><img src="https://3732705674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaQ7wCJOT0ZaejHUiD6sb%2Fuploads%2FAGzBvKQBfND6ZQgsQIbV%2FdatabaseStepProcessor.drawio%20(1).png?alt=media&#x26;token=b32fa746-6303-4165-a0f5-3d6631e18312" alt=""><figcaption></figcaption></figure>

### Data Base Retrieve Step Processor

<figure><img src="https://3732705674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaQ7wCJOT0ZaejHUiD6sb%2Fuploads%2FsaAb2CoIFDP0YJOH2DYP%2Fdatabase%20RetrievestepProcessor.drawio.png?alt=media&#x26;token=4c706d15-d729-49cc-8e60-a853830f8c5e" alt=""><figcaption></figcaption></figure>

## <mark style="color:blue;">Functionality</mark>

In the database adapter, we are able to access and perform operations on different databases such as MySQL, MS SQL, and Oracle. The adapter has separate functionality for Database Insertion Step Processor and Database Retrieve Step Processor, as well as a Database Step Processor. Native insert queries are used to fetch data directly from the database, and it is possible to connect to stored procedures to extract insert data.

The adapters inherit from dbHandler, which performs logical operations on the data. The handler processes data in different ways, such as through stored procedures and batch queries. Database connection details and queries are passed through steps, with the step type corresponding to the respective adapter. Once the database connection is established successfully, a query statement is created from the step data and executed on the database.

## <mark style="color:blue;">Capabilities</mark>

* Directly fetch the data from the database using normal queries
* Can connect to stored procedure & extract the insertion data
* Retrieval and insertion of multiple records is possible

## <mark style="color:blue;">DB Handlers</mark>

<details>

<summary><a href="https://oresund-integration-platform.gitbook.io/oresund-integration-platform/about/product-and-developer-guide/adapters/database-adapter/db-insert-handler">DB Insert Handler</a></summary>

</details>

<details>

<summary><a href="https://oresund-integration-platform.gitbook.io/oresund-integration-platform/about/product-and-developer-guide/adapters/database-adapter/db-retrieve-handler">DB Retrieve Handler</a></summary>

</details>
