zmerr
zmerr

Reputation: 574

Akka Projection configuration for a JDBC database connection

In Akka Projection’s documentation under offsetting in a relational database with JDBC, there is no information about how and where the configuration for establishing a connection to the relational database used should be included. I mean configs such as the username, password, or the url.

In the documentation under offset in a relational database with Slick, the following configuration is provided for the database connection, which is unclear whether it can be used for JDBC as well:

# add here your Slick db settings
  db {
    # url = "jdbc:h2:mem:test1"
    # driver = org.h2.Driver
    # connectionPool = disabled
    # keepAliveConnection = true
  }

How and where should I specify the JDBC connection parameters?

Upvotes: 1

Views: 434

Answers (1)

Michał Pawlicki
Michał Pawlicki

Reputation: 421

https://doc.akka.io/docs/akka-projection/current/jdbc.html#defining-a-jdbcsession

The following line in the Scala code snippet is where you can specify connection parameters:

val c = DriverManager.getConnection("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1")

Upvotes: 2

Related Questions