Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

ERROR:

Oct 25, 2020 7:40:55 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.4.9.Final}
Oct 25, 2020 7:40:56 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager
INFO: HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
Oct 25, 2020 7:40:57 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

Servlet File

String title = request.getParameter("title");
String content = request.getParameter("content");
			
Configuration cfg = new Configuration().configure();
SessionFactory sf = cfg.buildSessionFactory();
Session session = sf.openSession();
Transaction transaction = session.beginTransaction();
Note note = new Note(title, content, new Date());
session.save(note);
transaction.commit();
System.out.println("Record inserted");
System.out.println(note);
session.close();

hibernate.cfg.xml

<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:rushi</property>
<property name="hibernate.connection.username">system</property>
<property name="hibernate.connection.password">rushi</property>
        
<property name="hbm2ddl.auto">create-drop</property>
<property name="show_sql">true</property>
<property name="hibernate.format_sql">true</property>

<mapping class="com.entities.Note"/>

Please help to resolve this issue

You didn’t post what kind of environment you are running in, but I assume it’s a custom one or Tomcat/Jetty? You should configure a connection pool like described here: https://docs.jboss.org/hibernate/stable/orm/userguide/html_single/Hibernate_User_Guide.html#database-connectionprovider-datasource or even better, use an environment like a Java EE server(Wildfly, Payara) that comes with connection pooling configuration out of the box.

Am getting same excepiton.
FAILURE! 17:26:42 org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 17:26:42 at com.sap.db.jdbc.exceptions.SQLExceptionSapDB._newInstance(SQLExceptionSapDB.java:191) 17:26:42 at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.newInstance(SQLExceptionSapDB.java:42) 17:26:42 at com.sap.db.jdbc.packet.HReplyPacket._buildExceptionChain(HReplyPacket.java:881) 17:26:42 at com.sap.db.jdbc.packet.HReplyPacket.getSQLExceptionChain(HReplyPacket.java:130) 17:26:42 at com.sap.db.jdbc.packet.HPartInfo.getSQLExceptionChain(HPartInfo.java:39) 17:26:42 at com.sap.db.jdbc.ConnectionSapDB._receive(ConnectionSapDB.java:2534) 17:26:42 at com.sap.db.jdbc.ConnectionSapDB.exchange(ConnectionSapDB.java:1507) 17:26:42 at com.sap.db.util.security.AuthenticationManager.authenticate(AuthenticationManager.java:115) 17:26:42 at com.sap.db.jdbc.ConnectionSapDB._getNewSession(ConnectionSapDB.java:2901) 17:26:42 at com.sap.db.jdbc.ConnectionSapDB._getNewConnection(ConnectionSapDB.java:2832) 17:26:42 at com.sap.db.jdbc.ConnectionSapDB.(ConnectionSapDB.java:194) 17:26:42 at com.sap.db.jdbc.ConnectionSapDBFinalize.(ConnectionSapDBFinalize.java:36) 17:26:42 at com.sap.db.jdbc.ConnectionSapDBFinalize.newInstance(ConnectionSapDBFinalize.java:23) 17:26:42 at com.sap.db.jdbc.Driver._connect(Driver.java:1441) 17:26:42 at com.sap.db.jdbc.Driver.connect(Driver.java:1068) 17:26:42 at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95) 17:26:42 at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101) 17:26:42 at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341) 17:26:42 at com.zaxxer.hikari.pool.HikariPool.checkFailFast(Hikari

Using RESTAssured to run API automation. Using hibernate to connect to HANA DB.
Can you please help me to resolve this ?? Using DBeaver am able to connect to HANA DB instance,but same thing is failing from API automation…

Hello, Am facing the same issue with exact errors, what could be the solution?

Here is the pastebin org.springframework.beans.factory.BeanCreationException: Error creating bean wit - Pastebin.com

Looking forward for your support

There are so many environments where all of this works great and out of the box. If you want to build a custom environment and run into errors due to misconfiguration or bugs in your code, then you are on your own.
The exceptions are all usually pretty clear. Hibernate is unable to acquire a connection through the connection provider, because the connection provider you are using has a problem (wrong credentials, network issue or whatever).