Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Armin Naderi
Armin Naderi
18,713 Points

How do I use one database to serve as the data source for multiple Spring repositories?

I currently have a Spring repository which is used to fetch rows from a single table in my database. The database is loaded within the class itself, but it probably shouldn't be judging from my previous treehouse courses. I want to pass a global database object into each and every new repository object I make. This does not seem possible right now since I am using the @Autowired annotation, which is not controlled by me. Any suggestions?