I'm trying to integrate hibernate with spring, and I asked-just to know if that possible or not-, can I use @Autowired and @Componentscan to do inject the BasicDataSource class?
With @ComponentScan
you can avoid declaring beans by loading them from Java-based configurations. This way, you still need a @Configuration
to provide a BasicDataSource
dependency.
After the BasicDataSource
dependency is scanned, it can be injected in other Spring components using @Autowired
or @Inject
.