I have to deal with an API which need to be provided a DataSource as a parameter. The problem is I’m accessing it from a context that provides an EntityManager or a PersistentContext, which do not appear to expose any DataSource through its methods.
How is it possible to programmatically retrieve the underlying DataSource from an EntityManager ?
I have to deal with an API which need to be provided a DataSource
Share
Solution is injecting datasource this way :
and then providing the datasource as an argument to the API.