The data source is just a bean. It can be entered by Spring in almost anything.
def dataSource
But I would recommend that you insert the data source into the service, make a call to getConnection and any work that you need. I believe the best separation of duties.
Then enter your service in your controller and call it.
source share