FEB wrote:
I think you can get the information through the settings object.
Code:
EntityManagerFactoryImpl impl = (EntityManagerFactoryImpl)getEntityManagerFactory();
SessionFactory sf = impl.getSessionFactory();
Settings settings = ((SessionFactoryImpl)sf).getSettings();
With the above solution you would still need to go through the Connection object, I think, as in the following snippet:
Code:
Settings settings = ((SessionFactoryImpl) sessionFactory).getSettings();
Assert.assertNotNull(settings);
Connection connection = settings.getConnectionProvider().getConnection();
System.err.println(connection.getMetaData().getURL());