How to configure second database (For only Select queries) in Spring Boot

97 Views Asked by At

I have a spring boot project with a MySql DB already configured along with the migration scripts.

I have a new requirement where I have to configure an Oracle database(part of another application) to my application.

I understand that we can configure multiple databases in spring boot project. But I need to configure Oracle DB such that the migration scripts writtrn for MySQL doesn't apply onto it as I have to perform only select queries on Oracle database.

I am expecting to configure the Oracle database as a read only database without affecting the existing configuration for MySQL database.

1

There are 1 best solutions below

0
ayasin On BEST ANSWER

The easiest solution would be creating a read-only user in the Oracle database, and in the application.properties file, you should replace the old database user information with the read-only user's information.