How to get database metadata from entity manager

前端 未结 6 1756
梦如初夏
梦如初夏 2021-02-07 09:00

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

6条回答
  •  迷失自我
    2021-02-07 09:29

    Use following line to get information related to your connection and datasource

    entityManager.getEntityManagerFactory().getProperties().get("hibernate.connection.datasource");
    

提交回复
热议问题