I have a spring boot application that will be communicating with two databases (Cassandra and DB2). I'll be using spring data in this application. Is it applicable to configure the data sources only in application.yml file, without writing java code. If so, how can I specify the dialect for each one?
Note: this application uses spring-data-cassandra for cassandra database and spring-data-jpa for db2 database.
For example:
spring:
datasource:
url: jdbc:db2://myRemoteHost:portNumber/MyDBName
username: username
password: password
driver-class-name: com.ibm.db2.jcc.DB2Driver
data:
cassandra:
cluster-name: cluster name
keyspace-name: keyspace name
port: myPortNumber
contact-points: host1.com
username: username
password: password
Note: This question is different from Spring Boot Configure and Use Two DataSources . My question is to know if it's applicable to configure the data sources only in application.yml file without doing it manually, while the other question explains how to do it manually.