How can you configure multiple DataSources in a Spring Boot application?
- By defining multiple @DataSource beans in the application context.
- By annotating the main application class with @MultipleDataSources.
- By modifying the application.properties or application.yml file.
- Spring Boot does not support multiple DataSources.
To configure multiple DataSources in a Spring Boot application, you typically modify the application.properties or application.yml file to define the necessary DataSource properties. Spring Boot provides a convenient way to configure DataSources through properties, making it easy to connect to multiple databases. The other options are not standard practices for configuring multiple DataSources in a Spring Boot application.
Loading...
Related Quiz
- In Spring Boot's project structure, where should the application properties file be placed?
- In Spring Boot, the _____ annotation is used to conditionally enable a configuration based on the presence of a specific property.
- How can you exclude certain auto-configuration classes in Spring Boot to prevent them from being applied?
- How can back pressure be handled in a reactive stream in Spring Boot?
- In a Spring Boot application, which annotation is primarily used to mark a method as cacheable?