Есть база данных поднятая на localhost:3306
, при попытке подключения выдается исключение:
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Создание соединения:
public DBService()
{
Configuration configuration = getMySqlConfiguration();
sessionFactory = createSessionFactory(configuration);
}
getMySqlConfiguration()
private Configuration getMySqlConfiguration() {
Configuration configuration = new Configuration();
configuration.addAnnotatedClass(ParkingTable.class);
configuration.addAnnotatedClass(CarTable.class);
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
configuration.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
configuration.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:3306/mydb");
configuration.setProperty("hibernate.connection.username", "root");
configuration.setProperty("hibernate.connection.password", "geo");
configuration.setProperty("hibernate.show_sql", hibernate_show_sql);
return configuration;
}
Все зависимости в prom
прописаны.