posted 5 years ago
I defined my datasource in application.properties.
Spring read the datasource properties, but in my main method in the Application class or even in a @RestMethod in that class, how do I access the DataSource reference so I can do some data access logic?
Spent a couple hours researching. Tried @Autowired and others like getJdbcTemplate() (which didn't compile) that did not work.
Thanks in advance,
- mike