I have an app which is using hibernate and jpa. I need to find out which db it is connected to so that some native sql query i execute based on db say for eg. oracle and postgre
Use following line to get information related to your connection and datasource
entityManager.getEntityManagerFactory().getProperties().get("hibernate.connection.datasource");