0

In my spring boot application I am using Oracle as the database. The database has different schemas. I have a requirement, to list all the schemas and connect to the database using that schema in a loop and do some query on the tables. I have seen some blogs to connect to different schemas by defining datasource in application.properties. I don't want to do that becuase I have around 40+ schemas defined and I don't want to define those many datasources.

1 Answer 1

1

I think it's a better solution to connect with one account (with read permission to all the schema's) to the database and use a simple SQL query to fetch all the schema's.

If you know the schema's you can build custom SQL queries to fetch the data from each schema. (select * from SCHEMA1.sometable)

I think it's not a good idea to create connection for each schema in your situation.

Sign up to request clarification or add additional context in comments.

1 Comment

sure, let me try that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.