How to connect Camunda to postgresql Database
In pom.xml file, add the below dependencies
In application.yaml file add content like below
code:
# ----------------------------------------------------
# 1. Camunda Admin User (Existing part)
# ----------------------------------------------------
camunda:
bpm:
admin-user:
id: username
password: password
# ----------------------------------------------------
# 2. Camunda Database Type (Tells Camunda to use Postgres dialect)
# ----------------------------------------------------
database:
type: postgres # <-- IMPORTANT!
# ----------------------------------------------------
# 3. Spring Boot Datasource Configuration (The Connection Details)
# ----------------------------------------------------
spring:
datasource:
url: jdbc:postgresql://localhost:5432/camunda_db # Change URL/Port/DB Name as needed
username: your_db_username # Your DB username
password: your_db_password_here # Your DB password
driver-class-name: org.postgresql.Driver
Note: Create the database camunda_db if the database is not yet created in DB Server.
open the terminal and in the root of the repository, run command mvn clean install
Next run command, mvn spring-boot:run
In database, we can able to see the tables now.
I have added 2 users ( manager, hr ) from admin portal
In table, we can see the created user in table. so we can confirm the application is connected to database.
Comments
Post a Comment