When you configure hibernate, the code is executed with errors:
Exception in thread "main" Java.lang.UnsupportedOperationException:The user must supply a JDBC Connectionat org.hibernate . Connection. Usersuppliedconnectionprovider.getconnection (usersuppliedconnectionprovider.java:54) at Org.hibernate.jdbc.ConnectionManager.openConnection (connectionmanager.java:446) at Org.hibernate.jdbc.ConnectionManager.getConnection (connectionmanager.java:167) at Org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement (abstractbatcher.java:161) at Org.hibernate.loader.Loader.prepareQueryStatement (loader.java:1616) at Org.hibernate.loader.Loader.doQuery ( loader.java:717) at Org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections (loader.java:270) at Org.hibernate.loader.Loader.loadEntity (loader.java:1953) at Org.hibernate.loader.entity.AbstractEntityLoader.load (abstractentityloader.java:86) at Org.hibernate.loader.entity.AbstractEntityLoader.load (abstractentityloader.java:76) at Org.hibernate.persister.entity.AbstractEntityPersister.load (Abstractentitypersister.java:3270) at Org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource (defaultloadeventlistener.java:496) At Org.hibernate.event.def.DefaultLoadEventListener.doLoad (defaultloadeventlistener.java:477) at Org.hibernate.event.def.DefaultLoadEventListener.load (defaultloadeventlistener.java:227) at Org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad (defaultloadeventlistener.java:285) at Org.hibernate.event.def.DefaultLoadEventListener.onLoad (defaultloadeventlistener.java:152) at Org.hibernate.impl.SessionImpl.fireLoad (sessionimpl.java:1080) at Org.hibernate.impl.SessionImpl.get ( sessionimpl.java:997) at Org.hibernate.impl.SessionImpl.get (sessionimpl.java:990) at Com.ado.test.hibernate.HibernateTest.main (HIBERNATETEST.JAVA:25)
Later looked at the background of the source code, found to create a ConnectionProvider instance of Usersuppliedconnectionprovider (user-defined provider), configuration is a bit unusual. Breakpoints track the code that created the instance because the configuration property keyword is not the same as the Hibernate keyword when it is created based on individual configuration properties, resulting in the creation of a user-defined provider, resulting in the exception above.
The test code uses Hibernate 3.5.6, a standard keyword that can be used to view definitions in the Org.hibernate.cfg.Environment class. Hibernate version is different, the use of the keyword is not the same. This should be noted.
Hibernate 3.5.6 is used by:
Hibernate.connection.driver_ Classhibernate.connection.urlhibernate.connection.usernamehibernate.connection.password
Hibernate---java.lang.UnsupportedOperationException:The user must supply a JDBC connection