You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
kle-dev
changed the title
Spring Data JDBCs Crud Repository with multiple datasources
Example for Spring Data JDBCs Crud Repository with multiple datasources
Nov 27, 2019
Hello together,
we may all knows that we can set up to a
JDBCTemplate
aDatasource
, so aJDBCTemplate
knows which datasource it has:JDBCTemplate JdbcTemplate = new JDBCTemplate(dataSource)
Whats about with a
CrudRepository
? How can aCrudRepository
knows to which database it should communicate to ? It is using the default one, all time. If we setup a second database in Configuration, aCrudRepositry
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.
The text was updated successfully, but these errors were encountered: