spring-projects / spring-projects/spring-data-examples
Example for Spring Data JDBCs Crud Repository with multiple datasources
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5.4k
- Forks
- 3.4k
- PR merge metrics
- No merged PRs in 30d
Description
Hello together,
we may all knows that we can set up to a JDBCTemplate a Datasource, so a JDBCTemplate knows which datasource it has: JDBCTemplate JdbcTemplate = new JDBCTemplate(dataSource)
Whats about with a CrudRepository ? How can a CrudRepository knows to which database it should communicate to ? It is using the default one, all time. If we setup a second database in Configuration, a CrudRepositry will use the first and primary one.
Is there an example of using CrudRepository with two databases ? I can't find one in web.
I post it also in stack overflow here
Thank you.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Spring Data JDBC example projects and their datasource configuration, then trace how CrudRepository is connected to a datasource. Done means the repository contains a clear example showing CrudRepository usage with two databases and explaining which datasource each repository uses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, databases, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100